Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- TEST_SIZE = 10000
- repeat = lambda f: (f(N) for N in range(0, TEST_SIZE))
- program = ("""
- #include <type_traits>
- template <typename ...> struct result;
- template <typename T>
- struct with_cache {
- using without_reference = typename std::remove_reference<T>::type;
- using type = result<""" + ', '.join(repeat(lambda N: "without_reference")) + """>;
- };
- template <typename T>
- struct without_cache {
- using type = result<
- """ + ',\n '.join(repeat(lambda N: "typename std::remove_reference<T>::type")) + """
- >;
- };
- using Result = with_cache<int>::type;
- int main() { }
- """)
- print(program)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement