Right now each pmt type is divided into two pieces: a value class and a wrapper class. There is a note of the value class saying that it shouldn't be instantiated directly. It would be nice to make it so that it can't be instantiated at all. There are a few options for how to do this below.
Use a pimpl. Rename the value class to be the impl class. The major difficulty here, is that the value classes are templates. If we wanted to write them in the compiled implementation file, then we need to instantiate every possible instance. This is possible, but it does limit the extensibility a little bit.
Make the value class a private subclass of the wrapper. This should be pretty easy to do, because we wouldn't have to reorganize the code very much.
Wait for c++20 support and use modules. This is a cop out answer, but it could work. If we control what is exported, then we don't have to export the value class.
As of right now, I would vote for option 2, but I am open to other opinions.
Right now each pmt type is divided into two pieces: a value class and a wrapper class. There is a note of the value class saying that it shouldn't be instantiated directly. It would be nice to make it so that it can't be instantiated at all. There are a few options for how to do this below.
As of right now, I would vote for option 2, but I am open to other opinions.