除了预处理器,我如何有条件地启用/禁用显式模板实例化?考虑:templatestructTheTemplate{/*blah*/};templatestructTheTemplate;templatestructTheTemplate;templatestructTheTemplate;templatestructTheTemplate;在某些编译条件下,Type3与Type1相同,Type4与Type2相同。发生这种情况时,我会收到错误消息。我想检测类型是否相同,而不是像中那样在Type3和Type4上实例化//thisdoesnotworktemplatestructTheTemp