Created
June 23, 2021 23:52
-
-
Save guilhermeleobas/10dfc45b2f87f8ccf6c63a63b95289af to your computer and use it in GitHub Desktop.
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
| #define BOOST_STRONG_TYPEDEF(T, D) \ | |
| struct TextEncodingDict { \ | |
| T t; \ | |
| D(const T t_) : t(t_){}; \ | |
| D(){}; \ | |
| D(const D& t_) : t(t_.t) {} \ | |
| D& operator=(const D& rhs) { \ | |
| t = rhs.t; \ | |
| return *this; \ | |
| } \ | |
| D& operator=(const T& rhs) { \ | |
| t = rhs; \ | |
| return *this; \ | |
| } \ | |
| operator T() const { return t; } \ | |
| operator T&() { return t; } \ | |
| bool operator==(const D& rhs) const { return t == rhs.t; } \ | |
| bool operator<(const D& rhs) const { return t < rhs.t; } \ | |
| }; | |
| BOOST_STRONG_TYPEDEF(int32_t, TextEncodingDict) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment