Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template <typename T, int int_param> struct dispatch_demo {
- void do_the_job_impl(int_v<0>)
- {
- std::cout << "zero" << std::endl;
- }
- void do_the_job_impl(int_v<1>)
- {
- std::cout << "one" << std::endl;
- }
- template <int v> void do_the_job_impl(int_v<v>)
- {
- std::cout << "generic" << std::endl;
- }
- void do_the_job()
- {
- do_the_job_impl(int_v<int_param>());
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement