[odb-users] ODB requires x++11

Paul Stath PStath at jmawireless.com
Wed Jul 19 15:03:01 EDT 2023


Hi Boris and Justin,

Line 165 in the odb/pointer-traits.hxx file is inside a template specialization for:
    template <typename T>
    class pointer_traits<std::auto_ptr<T> >

The full output from the compile command would be very helpful, since it would show what compilation units are including the "pointer-traits.hxx" file.

Even without that output, I would guess that a 'std::auto_ptr' is being used somewhen and when compiled with a C++17 compiler, the error is generated when the template is being expanded.

The 'std::auto_ptr' could easily be in the generated ODB code if the "--default-pointer: argument with a value of "std::auto_ptr" is specified in the ODB compiler command line.

I would suggest searching for "auto_ptr" in the source files of the project.  (Including the generated ODB files.)
In order to compile with C++17 or later, these would need to be converted to "std::unique_ptr".

--- Paul


> -----Original Message-----
> From: Boris Kolpackov <boris at codesynthesis.com>
> Sent: Wednesday, July 19, 2023 11:14 AM
> To: Justin Armstrong <justinarmstrong at vectormagnetics.com>
> Cc: odb-users at codesynthesis.com
> Subject: Re: [odb-users] ODB requires x++11
> 
> Justin Armstrong <justinarmstrong at vectormagnetics.com> writes:
> 
> > 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
> 
> Hm, interesting, maybe we should exclude this specialization for later C++
> versions.
> 
> The strange thing is that we don't have any issues with it even though we are
> compiling with up to C++23 using pretty much every compiler (GCC, Clang,
> MSVC). Can you share the compiler/version as well as the exact command line
> that you are using to compile your code? There must be something like -
> pedantic that causes this.
> 




More information about the odb-users mailing list