This file contains 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 <cstddef> | |
#include <tuple> | |
#include <utility> | |
#include <sstream> | |
#include <vector> | |
template <typename Tuple, typename F, std::size_t ...Indices> | |
void for_each_impl(Tuple&& tuple, F&& f, std::index_sequence<Indices...>) { | |
using swallow = int[]; |
This file contains 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> | |
class BaseVisitor | |
{ | |
public: | |
virtual ~BaseVisitor() {} | |
}; | |
template <class T, typename R = void> | |
class Visitor { |
This file contains 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> | |
class Derived0; | |
class Derived1; | |
template <typename R, typename ...Args> | |
class IVisitor | |
{ | |
public: | |
virtual R visit(Derived0*, Args...) = 0; |
This file contains 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 "Test3dScene.h" | |
#include "2d/CCActionInterval.h" | |
#include "2d/CCCamera.h" | |
#include "2d/CCSprite.h" | |
#include "3d/CCAnimate3D.h" | |
#include "3d/CCAnimation3D.h" | |
#include "3d/CCSprite3D.h" | |
#include "base/CCDirector.h" | |
#include "base/ccTypes.h" | |
#include "math/CCGeometry.h" |
This file contains 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> | |
int main(int argc, const char * argv[]) { | |
int *a = nullptr; | |
int b = 10; | |
auto foo = [&b](int *&a) { a = &b; }; | |
foo(a); | |
std::cout << *a << std::endl; | |
return 0; | |
} |
This file contains 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> | |
class A { | |
public: | |
A(int i) : a(i) {} | |
int a; | |
int& GetA() { return a; } | |
}; | |
int main(int argc, const char * argv[]) { |
This file contains 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> | |
int main(int argc, const char * argv[]) { | |
int n = 0; | |
std::cout << "Enter n:"; | |
std::cin >> n; | |
int n1 = 0, n2 = 1, sum = 1; | |
while (sum < n) | |
{ |