MSVC - 禁止使用消息编译模板

MSVC - Suppress template being compiled with messages

我有一个使用大量模板和模板特化的应用程序,在 MSVC 编译过程中输出了许多消息,显示模板是如何编译的。这使得查找实际编译错误变得异常困难。使用 g++ 在 Linux 上编译应用程序时不会输出这些消息。

    C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\map(382)
: see reference to function template instantiation 'std::pair<std::_Tree_iterator<std::_Tree_val<std::_Tree_simple_types<std::pair<const _Kty,_Ty>>>>,bool> std:
:_Tree<std::_Tmap_traits<_Kty,_Ty,_Pr,_Alloc,true>>::insert<std::pair<std::string,uint64_t>>(_Valty &&)' being compiled
    with
    [
        _Kty=std::string
,            _Ty=size_t
,            _Pr=std::less<std::string>
,            _Alloc=std::allocator<std::pair<const std::string,size_t>>
,            _Valty=std::pair<std::string,uint64_t>
    ]

有什么方法可以抑制这些或多或少无用的消息吗?或者可能降低冗长设置?我试过查看 link,但我不确定是否有与我看到的消息相关的标志。

该消息与特定模板实例化的警告(或错误)有关。如果是警告,您可以抑制它(通过#pragma warning 或项目设置),此消息也会消失。或者,您可以修复警告的原因。没有办法在不同时抑制警告的情况下抑制此消息,因为没有它,警告就没有多大意义。