2016-09-07 3 views
8

जब मैं /std:c++latest ध्वज के साथ MSVC2015 साथ बढ़ावा बनाने की कोशिश मैं एक त्रुटि मिलती है:/एसटीडी के साथ MSVC2015 साथ बढ़ावा संकलन: C++ नवीनतम (या सी ++ 17/N4190)

boost\algorithm\string\detail\case_conv.hpp(33): error C2143: syntax error: missing ',' before '<' 

कौन सा अंक करने के लिए: https://www.visualstudio.com/en-us/news/releasenotes/vs2015-update3-vs

/std:c++latest also controls the removal of the following old features: N4190 "Removing auto_ptr, random_shuffle(), And Old Stuff", P0004R1 "Removing Deprecated Iostreams Aliases", LWG 2385 "function::assign allocator argument doesn't make sense", and various non-Standard features (the std::tr1 namespace, some TR1-only machinery, and the std::identity struct).

का उपयोग करते समय:

// a tolower functor 
template<typename CharT> 
struct to_lowerF : public std::unary_function<CharT, CharT> 

अब इस N4190 के कारण होने का यहाँ उल्लेख किया लगता है

std::string a,b; 
return boost::iequals(a,b); 

और boost::ilexicographical_compare का उपयोग कर।

इसकी भी यहाँ उल्लेख किया: C++ नवीनतम:

https://blogs.msdn.microsoft.com/vcblog/2015/06/19/c111417-features-in-vs-2015-rtm/

Stephan T. Lavavej - MSFT 

Azarien: Removing auto_ptr/etc. will have positive consequences. It will prevent new code from using outdated/complicated/unsafe 

machinery, and it will reduce confusion among non-expert users. (For example, unnecessary unary_function/binary_function inheritance is common, because many users thought that STL algorithms/containers required this, when in fact only the outdated adapters did.) And auto_ptr in particular is unsafe, because its mutating "copy" constructor silently moves from lvalues.

तो मैं कैसे VC2015 के/एसटीडी के साथ संकलित करने के लिए बढ़ावा मिलता है? अभी यह प्रतीत होता है कि सी ++ 17 संगत नहीं है?

+0

रिपोर्ट मुद्दा .. http://www.boost.org/development/bugs.html .. https: // SVN। boost.org/trac/boost/newticket – GrafikRobot

उत्तर

9

किसी भी हेडर सहित पहले मैक्रो _HAS_AUTO_PTR_ETC को परिभाषित करें। अपने कोड के लिए, यदि आप विजुअल स्टूडियो के निर्माण प्रणाली का उपयोग कर रहे हैं, तो यह आपके प्रोजेक्ट के Preprocessor Definitions setting के माध्यम से सबसे अच्छा है। बूस्ट के निर्माण के लिए, define=_HAS_AUTO_PTR_ETC को अपने b2/bjam आमंत्रण में जोड़ें।

अन्य पूर्व-मानक परोक्ष /std:c++latest रूप से अक्षम कार्यक्षमता मैक्रो _HAS_FUNCTION_ASSIGN, _HAS_OLD_IOSTREAMS_MEMBERS, और _HAS_TR1_NAMESPACE को परिभाषित करने के द्वारा नियंत्रित किया जा सकता है। इन मैक्रो सभी निम्न ब्लॉग लेख में दिए गए हैं:

STL Fixes In VS 2015 Update 3
VS 2015 Update 2’s STL is C++17-so-far Feature Complete

संबंधित मुद्दे