0

I am using C++ Builder 10.2.3. I need to store from simple to complex data types, and restore them:

int
float
.
.
std::vector<int>
std::vector<br::Transform*>() /* Transform is a user created class*/
etc...

I already tried Variant and TValue. Unfortunately they cannot store and restore complex data like std::vector<br::Transform*>(). And I cannot create new Variant types for each of them as I explained in a previous question. There are too many of complex data types!

Any hint?

Louis
  • 75
  • 6
  • I was just thinking about boost libraries. I don't know what they can do. Can they be a solution? – Louis Nov 22 '21 at 00:04
  • In C world, you can use a simply ```void*```, if the only common abstraction of these type are that they absolutely need some storage. – user8510613 Nov 22 '21 at 02:23
  • I don't think that it will work. Because I have to define typedef with maps and vectors. In the same way, I am trying to use templates instead to see if I can replace all of them. – Louis Nov 22 '21 at 03:18
  • Have you tried `std::variant` yet? It won't work in the classic Borland compiler, but it will in the Clang compilers. – Remy Lebeau Nov 22 '21 at 08:56
  • It seems to me that you told me previously that it is bugged? And can it store and restore complex types like std::vector ? – Louis Nov 22 '21 at 14:41
  • The comment I posted first. I know that std::variant in C++ Builder is bugged. But what about boost::variant? Did somebody tried that before? This will help me safe time. – Louis Nov 22 '21 at 19:11

0 Answers0