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.
The 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
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.
The 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