[Info-vax] OpenVMS Development Annoyances
Arne Vajhøj
arne at vajhoej.dk
Sun Apr 7 09:10:03 EDT 2019
On 4/7/2019 1:55 AM, John Reagan wrote:
> As for platform-specific addons for descriptors, etc. Would you
> rather have things added to std::string (like being able to ask for a
> descriptor of the data) or a new vms::string that inherits from
> std::string? I've play with both (and even considered C++17's
> string_view) and none jump out as the "best".
I would tend to say neither.
Adding VMS specific stuff to a std:: type if going to make it
difficult to identify code as being VMS specific and in general
I think hacking std:: types is a bad design unless very clearly
suggested in the language spec.
But I also don't like vms::string inheriting from std::string. Either
the application will use vms:string and VMS specific libraries all
over or it will end up with a lot of copy constructor calls to get from
std::string to vms::string. That type of inheritance is rarely good.
I will recommend the primitive solution:
std::string s;
vms::string_descriptor = vms::get_descrptor(s);
No messing around with classes - just a simple function that does the job.
Arne
More information about the Info-vax
mailing list