- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a simple code : in toto.ixx file :
module;
#include <iostream>
#include <typeinfo>
#include <utility>
export module math;
template <typename T>
auto showType(T&&t)
{
return typeid(std::forward<T>(t)).name();
}
export namespace math
{
template <typename T, typename T2>
auto sum(T fir, T2 sec)
{
auto res = fir + sec;
return std::make_pair(res, showType(res));
}
}
and in ConsoleApplication3.cpp :
#include <iostream>
import math;
int main()
{
auto [val, message] = math::sum(2000, 3.14159);
std::cout << "math::sum(2000, 11) : " << val << "; type: " << message << '\n';
}
This compiles and executes fine with latest Visual Studio Professional 2022 C++ compiler while it doesn't compile with Intel C++ 2025 compiler, the build output being :
1>------ Build started: Project: ConsoleApplication3, Configuration: Debug x64 ------
1>C:\pah\to\solutions\ConsoleApplication3\ConsoleApplication3\ConsoleApplication3.cpp(2,8): : error : module 'math' not found
1> 2 | import math;
1> | ~~~~~~~^~~~
1>1 error generated.
1>Done building project "ConsoleApplication3.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Build completed at 17:32 and took 02.479 seconds ==========
Of course "Preview - Features from the Latest C++ Working Draft (/std:c++latest)" is activated.
What is happening ?
Link Copied
0 Replies

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page