Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- template <class T>
- struct test_obj {};
- template <>
- struct test_obj<signed int> {
- const char *get() const {
- return "int";
- }
- };
- template <>
- struct test_obj<unsigned int> {
- const char *get() const {
- return "unsigned int";
- }
- };
- template <typename T>
- test_obj<T> tst(T) {
- return test_obj<T>();
- }
- int main() {
- puts(tst(1 << 31u).get());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement