Created
May 7, 2014 06:59
-
-
Save minamiyama1994/f052a7a970a89011031f to your computer and use it in GitHub Desktop.
C++でコンパイル時eval(誇張あり) ref: http://qiita.com/minamiyama1994/items/60213c62a54998bb431e
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<typeinfo> | |
#include"CTE/CTE.hpp" | |
auto main ( ) -> int | |
{ | |
auto eval1 = CTE_EVAL ( "1+20*10/(5+5)" ) ; | |
auto eval2 = CTE_EVAL ( "1+20*10/(5+5)+.5" ) ; | |
auto eval3 = CTE_EVAL ( u8R"*****("Hello"+" "+"World")*****" ) ; | |
std::cout << eval1 << std::endl ; | |
std::cout << typeid ( eval1 ).name ( ) << std::endl ; | |
std::cout << eval2 << std::endl ; | |
std::cout << typeid ( eval2 ).name ( ) << std::endl ; | |
std::cout << eval3 << std::endl ; | |
std::cout << typeid ( eval3 ).name ( ) << std::endl ; | |
} |
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
$ ./prog | |
21 | |
i | |
21.5 | |
d | |
Hello World | |
Ss |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment