C++ 17 Standardına Göre Derleme İşlemi (Compile With C++ 17 Linux)

Eigen yüklenmesi için  – Github Ayrıntı İçin

Bir kodu C++ kodunu C++ 17 standardına göre derlemek için aşağıda argümanı kullanmamız gerekir.

-std=c++1z

 

Örneğin eigen için kullandığımız kodu c++ 17 ile derlemek için aşağıdaki gibi bir söz dizimi kullanabiliriz.

g++ -std=c++1z -I/usr/include/eigen3 deneme.cpp -o sonuc

Aşağıdaki tabloda C++ 17 Dil özelliklerini destekleyen gcc sürümleri listelenmiştir.

Language FeatureProposalAvailable in GCC?SD-6 Feature Test
Removing trigraphsN40865.1 
u8 character literalsN42676__cpp_unicode_characters >= 201411
Folding expressionsN42956__cpp_fold_expressions >= 201411
Attributes for namespaces and enumeratorsN42664.9 (namespaces) 6 (enumerators)cpp_namespace_attributes >= 201411cpp_enumerator_attributes >= 201411
Nested namespace definitionsN42306__cpp_nested_namespace_definitions >= 201411
Allow constant evaluation for all non-type template argumentsN42686__cpp_nontype_template_args >= 201411
Extending static_assertN39286__cpp_static_assert >= 201411
New Rules for auto deduction from braced-init-listN39225 
Allow typename in a template template parameterN40515 
attributeP0188R17__has_cpp_attribute(fallthrough)
attributeP0189R14.8 () 7 (P0189R1)__has_cpp_attribute(nodiscard)
attributeP0212R14.8 () 7 (P0212R1)__has_cpp_attribute(maybe_unused)
Extension to aggregate initializationP0017R17__cpp_aggregate_bases >= 201603
Wording for constexpr lambdaP0170R17__cpp_constexpr >= 201603
Unary Folds and Empty Parameter PacksP0036R06__cpp_fold_expressions >= 201603
Generalizing the Range-Based For LoopP0184R06__cpp_range_based_for >= 201603
Lambda capture of *this by ValueP0018R37__cpp_capture_star_this >= 201603
Construction Rules for enum classvariablesP0138R27 
Hexadecimal floating literals for C++P0245R13.0__cpp_hex_float >= 201603
Dynamic memory allocation for over-aligned dataP0035R47__cpp_aligned_new >= 201606
Guaranteed copy elisionP0135R17 
Refining Expression Evaluation Order for Idiomatic C++P0145R37 
constexpr ifP0292R27__cpp_if_constexpr >= 201606
Selection statements with initializerP0305R17 
Template argument deduction for class templatesP0091R37__cpp_deduction_guides >= 201606
Declaring non-type template parameters with autoP0127R27__cpp_template_auto >= 201606
Using attribute namespaces without repetitionP0028R47 
Ignoring unsupported non-standard attributesP0283R2Yes 
Structured bindingsP0217R37__cpp_structured_bindings >= 201606
Remove Deprecated Use of the register KeywordP0001R17 
Remove Deprecated operator++(bool)P0002R17 
Make exception specifications be part of the type systemP0012R17__cpp_noexcept_function_type >= 201510
__has_include for C++17P0061R15 
Rewording inheriting constructors (core issue 1941 et al)P0136R17__cpp_inheriting_constructors >= 201511
Inline variablesP0386R27__cpp_inline_variables >= 201606
DR 150, Matching of template template argumentsP0522R07__cpp_template_template_args >= 201611
Removing dynamic exception specificationsP0003R57 
Pack expansions in using-declarationsP0195R27__cpp_variadic_using >= 201611
A byte type definitionP0298R07