1 2 3 4 5 6 7 8 9 10 11 12 13 14
export module work; import std; export template<typename T> void do_work() { if constexpr (std::is_same_v<T, int>) { std::println("Hello world!"); } else if constexpr (std::is_same_v<T, double>) { std::println("Hello test!"); } else { std::println("Hello unknown type!"); } }