简体   繁体   中英

Clang 3.3 and C++14 support?

Clang 3.3 supports some C++14 features, like member initializers and aggregates. However, I am unable to compile this code even with -std=c++11 switch.

struct A
{
   struct X { int a, b; };
   X x = { 1, 2 };
   int n;
};

A a = {{10}, 5};

What am I doing wrong?

Post-C++11 language features in Clang 3.3 are enabled with this command-line switch:

-std=c++1y

Check out the bottom of this page http://clang.llvm.org/cxx_status.html for the list of currently supported post-C++11 features in Clang 3.3 .

Also, here you will find discussions on the upcoming C++14 and usage examples: http://www.meetingcpp.com/index.php/br/items/a-look-at-cpp14-papers-part-1.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM