commit all code

This commit is contained in:
Changkun Ou
2016-08-20 13:00:44 +08:00
parent 9fd731448b
commit 75b6a4750e
33 changed files with 1294 additions and 2 deletions

33
8/8.2.cpp Normal file
View File

@@ -0,0 +1,33 @@
//
// 8.2.cpp
// c++1x tutorial
//
// created by changkun at shiyanlou.com
//
// 字面量
#include <iostream>
#include <string>
std::string operator"" _wow1(const char *wow1, size_t len) {
return std::string(wow1)+"woooooooooow, amazing";
}
std::string operator""_wow2 (unsigned long long i) {
return std::to_string(i)+"woooooooooow, amazing";
}
int main() {
std::string str = R"(C:\\What\\The\\Fxxk)";
std::cout << str << std::endl;
int value = 0b1001010101010;
std::cout << value << std::endl;
auto str = "abc"_wow1;
auto num = 1_wow2;
std::cout << str << std::endl;
std::cout << num << std::endl;
return 0;
}