I am in the process of converting my old code to something that is importable as c++-modules. The problem is that i would want it to still work and be easily maintained as the old header/source version. How do I do this (if possible).
Is it possible to create a module that export the content of a header? (Any other solution that lets you maintain old .cpp/.h files and module files is also accepted)
Toy example:
// In vector.h
template <typename T>
struct Vector {
T x, y;
}
// In .cppm
export module vector;
// #include "vector.h"
// Export struct/class Vector from header
What i have tried is just export Vector in different versions, with and without templates etc.
Bonus question: Can you do this for the std lib? (for exmaple iostream, or string)