[odb-users] ODB requires x++11

Justin Armstrong justinarmstrong at vectormagnetics.com
Tue Jul 18 11:09:30 EDT 2023


Thanks for getting back to me.

Sorry I mistyped, I meant auto_ptr. In odb/pointer-traits.hxx line 165 I get an error when compiling with -std=c++17. So the issue I’m having is in the supporting code not the odb generated code.



pointer-traits.hxx

// Specialization for std::auto_ptr.
  //
  template <typename T>
  class pointer_traits< std::auto_ptr<T> > // line 165
  {
  public:
    static const pointer_kind kind = pk_unique;
    static const bool lazy = false;


On Jul 18, 2023, at 10:45 AM, Boris Kolpackov <boris at codesynthesis.com<mailto:boris at codesynthesis.com>> wrote:

Justin Armstrong <justinarmstrong at vectormagnetics.com<mailto:justinarmstrong at vectormagnetics.com>> writes:

The requirement for c++11 is becoming a bit problematic as other 3rd party
code bases that we use require c++17 and 17 does not support smart pointers
which are used in ODB.

Hm, I am not aware of any C++11 smart pointers that have been deprecated
in C++17. Which smart pointers are you referring to?

Perhaps you are not invoking the ODB compiler with the --std c++11
option and are therefore getting C++98 auto_ptr?


Is there a plan to update to a newer version of c++?

If you get the latest pre-release[1], it supports --std c++14 and
--std c++17. We ourselves use code generated with --std c++14 in
quite a few projects that are compiled with up to C++23 without
any issues.


[1] https://codesynthesis.com/products/odb/doc/install-build2.xhtml
[EXTERNAL EMAIL] DO NOT CLICK links or attachments unless you recognize the sender and know the content is safe.



More information about the odb-users mailing list