تشخیص استاندارد C++ - هفت خط کد انجمن پرسش و پاسخ برنامه نویسی

تشخیص استاندارد C++

+3 امتیاز

سلام دوستان. آیا روشی وجود داره که بشه تشخیص داد در ide  که با آن برنامه نویسی c++ رو انجام می دیم، از چه نوع استانداری با توجه به استانداردهای موجود در شکل زیر استفاده می کنیم؟

c++, استاندارد, ide

سوال شده مرداد 24, 1393  بوسیله ی Pashmak (امتیاز 644)   8 15 31
ویرایش شده دی 30, 1393 بوسیله ی haniye sarbazi
IDE که مهم نیست. کامپایلر مهمه که باید ببینید چه ورژنیه.
منظورم همون کامپایلره. روشی برای این کار وجود داره؟

2 پاسخ

+3 امتیاز
 
بهترین پاسخ
 راه خاصی برای چک کردن این که  دقیقا  چه نسخه ای از c++ پشتیبانی میشه وجود نداره 
برای این که بفهمید آیا از c++11 پشتیبانی میشه 
#if __cplusplus > 199711L

#endif

ورژن ویژوال استودیو رو  میشه با ماکرو  _MSC_VER فهمید  (مقدار هر ورژن 100 تا بیشتر میشه )

VC 2010 :  1600
VC 2012 :  1700
VC 2013 :  1800

ویژگی هایی هم که 3 ورژن آخر پشتیبانی می کنن داخل این لینک هست http://msdn.microsoft.com/en-us/library/hh567368.aspx

 

 

 

 

 

پاسخ داده شده مرداد 25, 1393 بوسیله ی BlueBlade (امتیاز 15,315)   15 18 89
انتخاب شد مرداد 27, 1393 بوسیله ی Pashmak
بابت پاسخ ممنون. متوجه نشدم که کد اولی رو چگونه استفاده کنم؟ همچنین استفاده از ماکرو MSC_VER_ به چه صورته؟
شما فرض کنید می خواهید از range based loop استفاده کنید که داخل c++11 به بعد اضافه شده با استفاده از macro اول به این شکل کد رو مینویسین :
    std::vector<int> vec(10);
#if __cplusplus > 199711L
    for (auto i : vec){
        std::cout << i;
    }
#else
    for (int i = 0; i < vec.size(); i++){
        std::cout << vec[i];
    }
#endif

حالا کد بالا اگر کامپایلر قدیمی هم باشه مشکلی نداره .
ifdef یک جور شرط برای زمان کامپایل هست اگر برقرار باشه کد داخلش کامپایل میشه .
از ماکرو _MSC_VER هم به همین شکل میشه استفاده کرد .
این پست رو ببینید http://www.7khatcode.com/82/%D9%81%D9%88%D8%A7%DB%8C%D8%AF-%D8%A7%D8%B3%D8%AA%D9%81%D8%A7%D8%AF%D9%87-%D8%A7%D8%B2-macro-%D9%87%D8%A7-%D8%AF%D8%B1-c-%DA%86%DB%8C%D9%87-%D8%9F?show=117#a117
کد شما رو به صورت زیر اجرا کردم
#include <iostream>
#include <vector>
using namespace std;

int main()
{
    vector<int> vec(10);
#if __cplusplus > 199711L
    for (auto i : vec){
        cout << i;
    }
#else
    for (int i = 0; i < vec.size(); i++){
        cout << vec[i];
    }
#endif
    cin.get();
}

خروجی که برای من ظاهر شد ده تا صفر پشت سر هم بود. این یعنی که شرط اول برقرار بوده پس کامپایلر نصب شده از C++11 پشتیبانی می کنه درسته؟
شرط اول هم اگر برقرار نباشه 10 تا صفر چاپ میشه چون 2 تا کد معادل هم هستن .
اگر IDE که دارید اون مقدار بین #if  رو کمرنگ نشون بده یعنی اون شرط برقرار نیست .
آلبته اگر از ویژوال استودیو استفاده می کنید شرط < 2013 برقرار نیست چون هنوز بصورت کامل از c++11 پشتیبانی نمی کنه
منظورتون اینه که فقط ویژوال استدیو 2013 از C++11 پشتیبانی میکنه و 2012 پشتیبانی نمی کنه؟
نه منظورم اینه که فعلا هیچ نسخه ای از ویژوال استودیو بصورت "کامل" از 11++c پشتیبانی نمی کنه . امکانات زیادی هستن که ویژوال 2013 هم نداره .(البته درصد زیادی ازc++11 شاید مثلا حدود 80% داخل ویژوال 2013 پشتییبانی میشه ) این ماکرو هم فقط وقتی عددش از اون مقدار بیشتر میشه که بصورت کامل پشتیبانی بشه .
چه ide  به طور کامل c++11 رو پشتیبانی میکنه؟
کامپایلر های gcc و clang کامل پشتیبانی می کنن . با ide های codeblocks یا Qt creator میشه از mingw که نسخه ویندوز gcc هست استفاده کرد .
+2 امتیاز

این چیزیه که Qt استفاده می کنه (از فایل qcompilerdetection.h)


/*
 * C++11 support
 *
 *  Paper           Macro
 *  N2341           Q_COMPILER_ALIGNAS
 *  N2341           Q_COMPILER_ALIGNOF
 *  N2427           Q_COMPILER_ATOMICS
 *  N2761           Q_COMPILER_ATTRIBUTES
 *  N2541           Q_COMPILER_AUTO_FUNCTION
 *  N1984 N2546     Q_COMPILER_AUTO_TYPE
 *  N2437           Q_COMPILER_CLASS_ENUM
 *  N2235           Q_COMPILER_CONSTEXPR
 *  N2343 N3276     Q_COMPILER_DECLTYPE
 *  N2346           Q_COMPILER_DEFAULT_MEMBERS
 *  N2346           Q_COMPILER_DELETE_MEMBERS
 *  N1986           Q_COMPILER_DELEGATING_CONSTRUCTORS
 *  N2437           Q_COMPILER_EXPLICIT_CONVERSIONS
 *  N3206 N3272     Q_COMPILER_EXPLICIT_OVERRIDES   (v0.9 and above only)
 *  N1987           Q_COMPILER_EXTERN_TEMPLATES
 *  N2540           Q_COMPILER_INHERITING_CONSTRUCTORS
 *  N2672           Q_COMPILER_INITIALIZER_LISTS
 *  N2658 N2927     Q_COMPILER_LAMBDA   (v1.0 and above only)
 *  N2756           Q_COMPILER_NONSTATIC_MEMBER_INIT
 *  N2855 N3050     Q_COMPILER_NOEXCEPT
 *  N2431           Q_COMPILER_NULLPTR
 *  N2930           Q_COMPILER_RANGE_FOR
 *  N2442           Q_COMPILER_RAW_STRINGS
 *  N2439           Q_COMPILER_REF_QUALIFIERS
 *  N2118 N2844 N3053 Q_COMPILER_RVALUE_REFS   (Note: GCC 4.3 implements only the oldest)
 *  N1720           Q_COMPILER_STATIC_ASSERT
 *  N2258           Q_COMPILER_TEMPLATE_ALIAS
 *  N2659           Q_COMPILER_THREAD_LOCAL
 *  N2765           Q_COMPILER_UDL
 *  N2442           Q_COMPILER_UNICODE_STRINGS
 *  N2640           Q_COMPILER_UNIFORM_INIT
 *  N2544           Q_COMPILER_UNRESTRICTED_UNIONS
 *  N1653           Q_COMPILER_VARIADIC_MACROS
 *  N2242 N2555     Q_COMPILER_VARIADIC_TEMPLATES
 *
 * C++1y proposed features
 *
 *  N3472           Q_COMPILER_BINARY_LITERALS
 *  N3649           Q_COMPILER_GENERIC_LAMBDA
 *  N3638           Q_COMPILER_LAMBDA_CAPTURES
 *  N3652           Q_COMPILER_RELAXED_CONSTEXPR_FUNCTIONS
 *  N3386 N3638     Q_COMPILER_RETURN_TYPE_DEDUCTION
 *  N3651           Q_COMPILER_VARIABLE_TEMPLATES
 *
 * C++14 Technical Specifications / C++17:
 *  N3639           Q_COMPILER_VLA  (see also Q_COMPILER_RESTRICTED_VLA)
 *
 */

#ifdef Q_CC_INTEL
#  define Q_COMPILER_RESTRICTED_VLA
#  define Q_COMPILER_VARIADIC_MACROS // C++11 feature supported as an extension in other modes, too
#  if __INTEL_COMPILER < 1200
#    define Q_NO_TEMPLATE_FRIENDS
#  endif
#  if __INTEL_COMPILER >= 1310 && !defined(_WIN32)
//    ICC supports C++14 binary literals in C, C++98, and C++11 modes
//    at least since 13.1, but I can't test further back
#     define Q_COMPILER_BINARY_LITERALS
#  endif
#  if __cplusplus >= 201103L
#    if __INTEL_COMPILER >= 1200
#      define Q_COMPILER_AUTO_TYPE
#      define Q_COMPILER_CLASS_ENUM
#      define Q_COMPILER_DECLTYPE
#      define Q_COMPILER_DEFAULT_MEMBERS
#      define Q_COMPILER_DELETE_MEMBERS
#      define Q_COMPILER_EXTERN_TEMPLATES
#      define Q_COMPILER_LAMBDA
#      define Q_COMPILER_RVALUE_REFS
#      define Q_COMPILER_STATIC_ASSERT
#      define Q_COMPILER_VARIADIC_MACROS
#    endif
#    if __INTEL_COMPILER >= 1210
#      define Q_COMPILER_ATTRIBUTES
#      define Q_COMPILER_AUTO_FUNCTION
#      define Q_COMPILER_NULLPTR
#      define Q_COMPILER_TEMPLATE_ALIAS
#      define Q_COMPILER_UNICODE_STRINGS
#      define Q_COMPILER_VARIADIC_TEMPLATES
#    endif
#    if __INTEL_COMPILER >= 1300
#      define Q_COMPILER_ATOMICS
//       constexpr support is only partial
//#      define Q_COMPILER_CONSTEXPR
#      define Q_COMPILER_INITIALIZER_LISTS
#      define Q_COMPILER_UNIFORM_INIT
#      define Q_COMPILER_NOEXCEPT
#    endif
#    if __INTEL_COMPILER >= 1400
#      define Q_COMPILER_CONSTEXPR
#      define Q_COMPILER_DELEGATING_CONSTRUCTORS
#      define Q_COMPILER_EXPLICIT_OVERRIDES
#      define Q_COMPILER_NONSTATIC_MEMBER_INIT
#      define Q_COMPILER_RAW_STRINGS
#      define Q_COMPILER_REF_QUALIFIERS
#      define Q_COMPILER_UNRESTRICTED_UNIONS
#    endif
#  endif
#endif

#if defined(Q_CC_CLANG) && !defined(Q_CC_INTEL)
/* General C++ features */
#  define Q_COMPILER_RESTRICTED_VLA
#  if !__has_feature(cxx_exceptions)
#    ifndef QT_NO_EXCEPTIONS
#      define QT_NO_EXCEPTIONS
#    endif
#  endif
#  if !__has_feature(cxx_rtti)
#    define QT_NO_RTTI
#  endif
#  if __has_feature(attribute_deprecated_with_message)
#    define Q_DECL_DEPRECATED_X(text) __attribute__ ((__deprecated__(text)))
#  endif

// Clang supports binary literals in C, C++98 and C++11 modes
// It's been supported "since the dawn of time itself" (cf. commit 179883)
#  if __has_extension(cxx_binary_literals)
#    define Q_COMPILER_BINARY_LITERALS
#  endif

// Variadic macros are supported for gnu++98, c++11, c99 ... since 2.9
#  if ((__clang_major__ * 100) + __clang_minor__) >= 209
#    if !defined(__STRICT_ANSI__) || defined(__GXX_EXPERIMENTAL_CXX0X__) \
      || (defined(__cplusplus) && (__cplusplus >= 201103L)) \
      || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))
#      define Q_COMPILER_VARIADIC_MACROS
#    endif
#  endif

/* C++11 features, see http://clang.llvm.org/cxx_status.html */
#  if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)
    /* Detect C++ features using __has_feature(), see http://clang.llvm.org/docs/LanguageExtensions.html#cxx11 */
#    if __has_feature(cxx_alignas)
#      define Q_COMPILER_ALIGNAS
#      define Q_COMPILER_ALIGNOF
#    endif
#    if 0 /* not implemented in clang yet */
#     define Q_COMPILER_ATOMICS
#    endif
#    if __has_feature(cxx_attributes)
#      define Q_COMPILER_ATTRIBUTES
#    endif
#    if __has_feature(cxx_auto_type)
#      define Q_COMPILER_AUTO_FUNCTION
#      define Q_COMPILER_AUTO_TYPE
#    endif
#    if __has_feature(cxx_strong_enums)
#      define Q_COMPILER_CLASS_ENUM
#    endif
#    if __has_feature(cxx_constexpr)
#      define Q_COMPILER_CONSTEXPR
#    endif
#    if __has_feature(cxx_decltype) /* && __has_feature(cxx_decltype_incomplete_return_types) */
#      define Q_COMPILER_DECLTYPE
#    endif
#    if __has_feature(cxx_defaulted_functions)
#      define Q_COMPILER_DEFAULT_MEMBERS
#    endif
#    if __has_feature(cxx_deleted_functions)
#      define Q_COMPILER_DELETE_MEMBERS
#    endif
#    if __has_feature(cxx_delegating_constructors)
#      define Q_COMPILER_DELEGATING_CONSTRUCTORS
#    endif
#    if __has_feature(cxx_explicit_conversions)
#      define Q_COMPILER_EXPLICIT_CONVERSIONS
#    endif
#    if __has_feature(cxx_override_control)
#      define Q_COMPILER_EXPLICIT_OVERRIDES
#    endif
#    if __has_feature(cxx_inheriting_constructors)
#      define Q_COMPILER_INHERITING_CONSTRUCTORS
#    endif
#    if __has_feature(cxx_generalized_initializers)
#      define Q_COMPILER_INITIALIZER_LISTS
#      define Q_COMPILER_UNIFORM_INIT /* both covered by this feature macro, according to docs */
#    endif
#    if __has_feature(cxx_lambdas)
#      define Q_COMPILER_LAMBDA
#    endif
#    if __has_feature(cxx_noexcept)
#      define Q_COMPILER_NOEXCEPT
#    endif
#    if __has_feature(cxx_nonstatic_member_init)
#      define Q_COMPILER_NONSTATIC_MEMBER_INIT
#    endif
#    if __has_feature(cxx_nullptr)
#      define Q_COMPILER_NULLPTR
#    endif
#    if __has_feature(cxx_range_for)
#      define Q_COMPILER_RANGE_FOR
#    endif
#    if __has_feature(cxx_raw_string_literals)
#      define Q_COMPILER_RAW_STRINGS
#    endif
#    if __has_feature(cxx_reference_qualified_functions)
#      define Q_COMPILER_REF_QUALIFIERS
#    endif
#    if __has_feature(cxx_rvalue_references)
#      define Q_COMPILER_RVALUE_REFS
#    endif
#    if __has_feature(cxx_static_assert)
#      define Q_COMPILER_STATIC_ASSERT
#    endif
#    if __has_feature(cxx_alias_templates)
#      define Q_COMPILER_TEMPLATE_ALIAS
#    endif
#    if __has_feature(cxx_thread_local)
#      define Q_COMPILER_THREAD_LOCAL
#    endif
#    if __has_feature(cxx_user_literals)
#      define Q_COMPILER_UDL
#    endif
#    if __has_feature(cxx_unicode_literals)
#      define Q_COMPILER_UNICODE_STRINGS
#    endif
#    if __has_feature(cxx_unrestricted_unions)
#      define Q_COMPILER_UNRESTRICTED_UNIONS
#    endif
#    if __has_feature(cxx_variadic_templates)
#      define Q_COMPILER_VARIADIC_TEMPLATES
#    endif
    /* Features that have no __has_feature() check */
#    if ((__clang_major__ * 100) + __clang_minor__) >= 209 /* since clang 2.9 */
#      define Q_COMPILER_EXTERN_TEMPLATES
#    endif
#  endif

/* C++1y features, see http://clang.llvm.org/cxx_status.html and
 * http://clang.llvm.org/docs/LanguageExtensions.html#checks-for-standard-language-features */
#  if __cplusplus > 201103L
//#    if __has_feature(cxx_binary_literals)
//#      define Q_COMPILER_BINARY_LITERALS  // see above
//#    endif
#    if __has_feature(cxx_generic_lambda)
#      define Q_COMPILER_GENERIC_LAMBDA
#    endif
#    if __has_feature(cxx_init_capture)
#      define Q_COMPILER_LAMBDA_CAPTURES
#    endif
#    if __has_feature(cxx_relaxed_constexpr)
#      define Q_COMPILER_RELAXED_CONSTEXPR_FUNCTIONS
#    endif
#    if __has_feature(cxx_decltype_auto) && __has_feature(cxx_return_type_deduction)
#      define Q_COMPILER_RETURN_TYPE_DEDUCTION
#    endif
#    if __has_feature(cxx_variable_templates)
#      define Q_COMPILER_VARIABLE_TEMPLATES
#    endif
#    if __has_feature(cxx_runtime_array)
#      define Q_COMPILER_VLA
#    endif
#  endif
#endif // Q_CC_CLANG

#if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && !defined(Q_CC_CLANG)
#  define Q_COMPILER_RESTRICTED_VLA
#  if (__GNUC__ * 100 + __GNUC_MINOR__) >= 403
//   GCC supports binary literals in C, C++98 and C++11 modes
#    define Q_COMPILER_BINARY_LITERALS
#  endif
#  if !defined(__STRICT_ANSI__) || defined(__GXX_EXPERIMENTAL_CXX0X__) \
    || (defined(__cplusplus) && (__cplusplus >= 201103L)) \
    || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))
     // Variadic macros are supported for gnu++98, c++11, C99 ... since forever (gcc 2.97)
#    define Q_COMPILER_VARIADIC_MACROS
#  endif
#  if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
#    if (__GNUC__ * 100 + __GNUC_MINOR__) >= 403
       /* C++11 features supported in GCC 4.3: */
#      define Q_COMPILER_DECLTYPE
#      define Q_COMPILER_RVALUE_REFS
#      define Q_COMPILER_STATIC_ASSERT
#    endif
#    if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404
       /* C++11 features supported in GCC 4.4: */
#      define Q_COMPILER_AUTO_FUNCTION
#      define Q_COMPILER_AUTO_TYPE
#      define Q_COMPILER_CLASS_ENUM
#      define Q_COMPILER_DEFAULT_MEMBERS
#      define Q_COMPILER_DELETE_MEMBERS
#      define Q_COMPILER_EXTERN_TEMPLATES
#      define Q_COMPILER_INITIALIZER_LISTS
#      define Q_COMPILER_UNIFORM_INIT
#      define Q_COMPILER_UNICODE_STRINGS
#      define Q_COMPILER_VARIADIC_TEMPLATES
#    endif
#    if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405
       /* C++11 features supported in GCC 4.5: */
#      define Q_COMPILER_EXPLICIT_CONVERSIONS
#      define Q_COMPILER_LAMBDA
#      define Q_COMPILER_RAW_STRINGS
#    endif
#    if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406
       /* C++11 features supported in GCC 4.6: */
#      define Q_COMPILER_CONSTEXPR
#      define Q_COMPILER_NULLPTR
#      define Q_COMPILER_UNRESTRICTED_UNIONS
#      define Q_COMPILER_RANGE_FOR
#    endif
#    if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407
       /* GCC 4.4 implemented <atomic> and std::atomic using its old intrinsics.
        * However, the implementation is incomplete for most platforms until GCC 4.7:
        * instead, std::atomic would use an external lock. Since we need an std::atomic
        * that is behavior-compatible with QBasicAtomic, we only enable it here */
#      define Q_COMPILER_ATOMICS
       /* GCC 4.6.x has problems dealing with noexcept expressions,
        * so turn the feature on for 4.7 and above, only */
#      define Q_COMPILER_NOEXCEPT
       /* C++11 features supported in GCC 4.7: */
#      define Q_COMPILER_NONSTATIC_MEMBER_INIT
#      define Q_COMPILER_DELEGATING_CONSTRUCTORS
#      define Q_COMPILER_EXPLICIT_OVERRIDES
#      define Q_COMPILER_TEMPLATE_ALIAS
#      define Q_COMPILER_UDL
#    endif
#    if (__GNUC__ * 100 + __GNUC_MINOR__) >= 408
#      define Q_COMPILER_ATTRIBUTES
#      define Q_COMPILER_ALIGNAS
#      define Q_COMPILER_ALIGNOF
#      define Q_COMPILER_INHERITING_CONSTRUCTORS
#      define Q_COMPILER_THREAD_LOCAL
#      if (__GNUC__ * 100 + __GNUC_MINOR__) > 408 || __GNUC_PATCHLEVEL__ >= 1
#         define Q_COMPILER_REF_QUALIFIERS
#      endif
#    endif
     /* C++11 features are complete as of GCC 4.8.1 */
#  endif
#  if __cplusplus > 201103L
#    if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409
     /* C++1y features in GCC 4.9 */
//#    define Q_COMPILER_BINARY_LITERALS   // already supported since GCC 4.3 as an extension
#      define Q_COMPILER_LAMBDA_CAPTURES
#      define Q_COMPILER_RETURN_TYPE_DEDUCTION
#    endif
#  endif
#endif

#if defined(Q_CC_MSVC) && !defined(Q_CC_INTEL)
#    if _MSC_VER >= 1400
       /* C++11 features supported in VC8 = VC2005: */
#      define Q_COMPILER_VARIADIC_MACROS

#      ifndef __cplusplus_cli
       /* 2005 supports the override and final contextual keywords, in
        the same positions as the C++11 variants, but 'final' is
        called 'sealed' instead:
        http://msdn.microsoft.com/en-us/library/0w2w91tf%28v=vs.80%29.aspx
        The behavior is slightly different in C++/CLI, which requires the
        "virtual" keyword to be present too, so don't define for that.
        So don't define Q_COMPILER_EXPLICIT_OVERRIDES (since it's not
        the same as the C++11 version), but define the Q_DECL_* flags
        accordingly: */
#      define Q_DECL_OVERRIDE override
#      define Q_DECL_FINAL sealed
#      endif
#    endif
#    if _MSC_VER >= 1600
       /* C++11 features supported in VC10 = VC2010: */
#      define Q_COMPILER_AUTO_FUNCTION
#      define Q_COMPILER_AUTO_TYPE
#      define Q_COMPILER_LAMBDA
#      define Q_COMPILER_DECLTYPE
#      define Q_COMPILER_RVALUE_REFS
#      define Q_COMPILER_STATIC_ASSERT
//  MSVC's library has std::initializer_list, but the compiler does not support the braces initialization
//#      define Q_COMPILER_INITIALIZER_LISTS
//#      define Q_COMPILER_UNIFORM_INIT
#    endif
#    if _MSC_VER >= 1700
       /* C++11 features supported in VC11 = VC2012: */
#       undef Q_DECL_OVERRIDE               /* undo 2005/2008 settings... */
#       undef Q_DECL_FINAL                  /* undo 2005/2008 settings... */
#      define Q_COMPILER_EXPLICIT_OVERRIDES /* ...and use std C++11 now   */
#      define Q_COMPILER_RANGE_FOR
#      define Q_COMPILER_CLASS_ENUM
#      define Q_COMPILER_ATOMICS
#    endif /* VC 11 */
#    if _MSC_VER >= 1800
       /* C++11 features in VC12 = VC2013 */
#      define Q_COMPILER_DEFAULT_MEMBERS
#      define Q_COMPILER_DELETE_MEMBERS
#      define Q_COMPILER_DELEGATING_CONSTRUCTORS
#      define Q_COMPILER_EXPLICIT_CONVERSIONS
#      define Q_COMPILER_NONSTATIC_MEMBER_INIT
// implemented, but nested initialization fails (eg tst_qvector): http://connect.microsoft.com/VisualStudio/feedback/details/800364/initializer-list-calls-object-destructor-twice
//      #define Q_COMPILER_INITIALIZER_LISTS
// implemented in principle, but has a bug that makes it unusable: http://connect.microsoft.com/VisualStudio/feedback/details/802058/c-11-unified-initialization-fails-with-c-style-arrays
//      #define Q_COMPILER_UNIFORM_INIT
#      define Q_COMPILER_RAW_STRINGS
#      define Q_COMPILER_TEMPLATE_ALIAS
#      define Q_COMPILER_VARIADIC_TEMPLATES
#    endif /* VC 12 */
#    if _MSC_FULL_VER >= 180030324 // VC 12 SP 2 RC
#      define Q_COMPILER_INITIALIZER_LISTS
#    endif /* VC 12 SP 2 RC */

#endif /* Q_CC_MSVC */

 

پاسخ داده شده شهریور 23, 1393 بوسیله ی PSPCoder (امتیاز 1,301)   14 40 57
سلام ممنون. C++1y چیه که توی این کد نوشته؟
c++14 هستش
...