[odb-users] constuct lazy_ptr with a given id

不明真相 icewill9999 at vip.qq.com
Wed Jul 21 04:12:36 EDT 2021


Hi,
From the ODB manual, the lazy_ptr could be constructed using the given id
  // Initialization with a persistent unloaded object.   //   template <class ID&gt; lazy_ptr (database&amp;, const ID&amp;);I tried the code below,odb::database* db = /////;int aid = ////;lazy_shared_ptr<AreaInfo&gt; aodbPtr(db, aid);
But the compiler reports the error messages:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\memory(667): error C2064: &nbsp;term does not evaluate to a function taking 1 arguments

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\memory(458): note: 参见对正在编译的函数 模板 实例化“void std::shared_ptr<T&gt;::_Resetp<_Ux,_Dx&gt;(_Ux *,_Dx)”的引用

        with

        [

            T=ProjectInfo::AreaInfo_type,

            _Ux=odb::database,

            _Dx=int

        ]

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\memory(458): note: 参见对正在编译的函数 模板 实例化“void std::shared_ptr<T&gt;::_Resetp<_Ux,_Dx&gt;(_Ux *,_Dx)”的引用

        with

        [

            T=ProjectInfo::AreaInfo_type,

            _Ux=odb::database,

            _Dx=int

        ]

F:\autonode\3rdParty\odb250\odb\odb/lazy-ptr.ixx(888): note: 参见对正在编译的函数 模板 实例化“std::shared_ptr<T&gt;::shared_ptr<Y,D&gt;(_Ux *,_Dx)”的引用

        with

        [

            T=ProjectInfo::AreaInfo_type,

            Y=odb::database,

            D=int,

            _Ux=odb::database,

            _Dx=int

        ]

F:\autonode\3rdParty\odb250\odb\odb/lazy-ptr.ixx(888): note: 参见对正在编译的函数 模板 实例化“std::shared_ptr<T&gt;::shared_ptr<Y,D&gt;(_Ux *,_Dx)”的引用

        with

        [

            T=ProjectInfo::AreaInfo_type,

            Y=odb::database,

            D=int,

            _Ux=odb::database,

            _Dx=int

        ]

..\andbbase\src\anDBNodeInfo.cpp(457): note: 参见对正在编译的函数 模板 实例化“odb::lazy_shared_ptr<ProjectInfo::AreaInfo_type&gt;::lazy_shared_ptr<odb::database,int&gt;(Y *,D)”的引用

        with

        [

            Y=odb::database,

            D=int

        ]

..\andbbase\src\anDBNodeInfo.cpp(457): note: 参见对正在编译的函数 模板 实例化“odb::lazy_shared_ptr<ProjectInfo::AreaInfo_type&gt;::lazy_shared_ptr<odb::database,int&gt;(Y *,D)”的引用

        with

        [

            Y=odb::database,

            D=int

        ]




Did I call this function a wrong way?

 Thanks.

 Regards, Wang


More information about the odb-users mailing list