4 ms·
Cool trick but why wouldn't you just put the Log method without the ifdef in the header, and put the conditionally compiled bits in a .cpp file? The method in t
by cherryteastain 1y ago
Cool trick but why wouldn't you just put the Log method without the ifdef in the header, and put the conditionally compiled bits in a .cpp file? The method in the article already puts both Widget<true> and Widget<false> in a .cpp file.
- stop50 1y agoThe thing that is complained on by the linker is not the method, its the m_logger attribute. because of that the two structs mismatch. But since Widget<true> and Widget<false> are two different structs in the typing system they don't interfere with each other