[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> lazy_ptr (database&, const ID&);I tried the code below,odb::database* db = /////;int aid = ////;lazy_shared_ptr<AreaInfo> 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: 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>::_Resetp<_Ux,_Dx>(_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>::_Resetp<_Ux,_Dx>(_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>::shared_ptr<Y,D>(_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>::shared_ptr<Y,D>(_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>::lazy_shared_ptr<odb::database,int>(Y *,D)”的引用
with
[
Y=odb::database,
D=int
]
..\andbbase\src\anDBNodeInfo.cpp(457): note: 参见对正在编译的函数 模板 实例化“odb::lazy_shared_ptr<ProjectInfo::AreaInfo_type>::lazy_shared_ptr<odb::database,int>(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