Visual Studio 2013 ã試ãã¦ã¿ã
å
æ¥ Visual Studio 2013 ããªãªã¼ã¹ãããã¨ãããã¨ãªã®ã§ C++11 çãªæå³ã§è©¦ãã¦ã¿ã¾ããã
Visual Studio 2013 ã§ã¯ä»¥ä¸ã® C++11 ã®æ©è½ãæ°ããå®è£
ããã¾ããã
- Non-static data member initializers
- Variadic templates
- Initializer lists
- Default template arguments for function templates
- Alias templates
- Delegating constructors
- Explicit conversion operators
- Raw string literals
- Defaulted and deleted functions
http://msdn.microsoft.com/en-us/library/vstudio/hh567368.aspx
[ã½ã¼ã¹]
#include <iostream> #include <vector> #include <string> // Variadic templates template<typename... Args> void func(Args... args){ // Initializer lists for(auto&& n : { args... }){ std::cout << n << std::endl; } } template<typename T> struct X{ T value; X(int n) : value(n){} }; struct person{ // Non-static data member initializers int age = 13; std::string name = "homu"; }; // Aliases templates template<typename T> using my_vector = std::vector<X<T>>; int main(){ std::cout << _MSC_VER << std::endl; // Initializer lists my_vector<int> v = { X<int>{1}, X<int>{2}, X<int>{3}}; for(auto&& n : v){ std::cout << n.value << std::endl; } func(1.1, 2.2, 3.3, 4.4, 5.5); person homu; std::cout << homu.name << std::endl; std::cout << homu.age << std::endl; return 0; }
[åºå]
1800 1 2 3 1.1 2.2 3.3 4.4 5.5 homu 13
Visual Studio 2012 ã¨ã¯ãªãã ã£ãã®ãâ¦ã¨ããå¢ã㧠C++11 ã®æ©è½ãå®è£
ããã¦ãã¾ããã
Variadic templatesãInitializer listsãNon-static data member initializers ããããå
¥ã£ã¦ãã£ã¨ã¾ã¨ãã« C++ ã®ã³ã¼ããæ¸ãããã§ãã
Alias templates ã Default template arguments for function templatesãRaw string literals ãå°å³ã«å¬ããã§ããã
ãã¨ã¡ã¸ã£ã¼ãªæ©è½ã§å®è£
ããã¦ããªãã®ã¯ constexpr ã Inheriting constructors ã User-defined literals ã constexpr ã constexpr ã§ããããã
C++14 ãè¦éã«å
¥ã£ã¦ãããããªã®ã§æ¬¡ã楽ãã¿ã§ããã