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 <iomanip> | |
| #include <time.h> | |
| #include <vector> | |
| struct Item { | |
| int a; | |
| Item(int i): a(i) { | |
| std::cout << "ctor" << std::endl; |
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 <stdint.h> | |
| template<typename T> | |
| inline void copy_byte(uint8_t* dst, uint8_t* src, size_t size ) { | |
| T* sdst = (T*)dst; | |
| T* ssrc = (T*)src; | |
| size /= sizeof(T); | |
| clock_t s = clock(); | |
| while (size-- > 0) |
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
| has_bom() | |
| { | |
| head -c3 "$1" | grep -qP '\xef\xbb\xbf'; | |
| } | |
| utf8bom() | |
| { | |
| echo "convert " $1 | |
| has_bom $1 | |
| if [ $? -ne 1 ]; then |
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 <assert.h> | |
| const char* code = "-1+2*3"; | |
| const char* token = nullptr; | |
| void init() { | |
| token = code; | |
| } |
OlderNewer