TARGET = C++11 #工程名CONFIG += console #控制台程序CONFIG -= app_bundle QMAKE_CXX = /usr/local/bin/gcc #编译器QMAKE_CXXFLAGS+= -std=c++11 #为编译器传递额外参数TEMPLATE = app #实用程序模板SOURCES += main.cpp
#include <iostream>long double operator"" cm(long double x) { return x / 100; }long double operator"" m(long double x) { return x; }long double operator"" km(long double x) { return x * 1000; }int main(){ std::cout << 1.2km+200.0m+20.0m+30.0cm << std::endl;}
#include <iostream>#include <cmath>int main(){ std::cout << [](float f)->int { return std::abs(f); } (-3.5) <<std::endl;}
whtsky:http://clang.llvm.org/cxx_status.html看起来clang的支持稍微好一点? (2012-06-07 21:03)