This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <chrono> | |
void tolower1(std::string& s) | |
{ | |
for (auto& c : s) | |
{ | |
if (c <= 'Z' && c >= 'A') | |
c = c - ('Z' - 'z'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <experimental\filesystem> | |
#include <iostream> | |
#include <fstream> | |
using namespace std; | |
using namespace std::experimental::filesystem; | |
int main(int argc, char* argv[]) | |
{ | |
if (argc < 2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <tuple> | |
#include <type_traits> | |
#include <cassert> | |
template <class T, class... TArgs> decltype(void(T{std::declval<TArgs>()...}), std::true_type{}) test_is_braces_constructible(int); | |
template <class, class...> std::false_type test_is_braces_constructible(...); | |
template <class T, class... TArgs> using is_braces_constructible = decltype(test_is_braces_constructible<T, TArgs...>(0)); | |
struct any_type { | |
template<class T> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
enum States { IDLE, MOVE, YUMYUM, EAT, DIE, CLEAR, FINISH }; | |
void RunLogic(States); | |
int main() | |
{ | |
// FSM : Finite State Machine (유한 상태 기계) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <map> | |
#include <type_traits> | |
#include <typeinfo> | |
#ifndef _MSC_VER | |
# include <cxxabi.h> | |
#endif | |
#include <memory> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string> | |
#include <future> | |
#include <vector> | |
#include <sstream> | |
#include <iostream> | |
class Unit | |
{ | |
public: | |
Unit() { } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <functional> | |
class AAA | |
{ | |
public: | |
bool A(int a, int b, int c) | |
{ | |
return a + b + c > 10; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
int main(int argc, char* argv[]) | |
{ | |
std::vector<int> v = {1, 2, 3, 4, 5}; | |
for (auto iter = v.rbegin(); iter != v.rend(); ++iter) | |
{ | |
std::cout << *iter << '\n'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <type_traits> | |
class Foo { | |
int v1; | |
double v2; | |
public: | |
Foo(int n) : v1(n), v2() {} | |
Foo(int n, double f) noexcept : v1(n), v2(f) {} | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <utility> | |
#include <iostream> | |
struct Default { int foo() const { return 1; } }; | |
struct NonDefault | |
{ | |
NonDefault(const NonDefault&) { } | |
int foo() const { return 1; } | |
}; |
OlderNewer