// forward declartion of pybind11::class_
namespace pybind11 {
template <typename, typename...>
class class_;
}
// try to friend the pybind11::class_
template<typename TTarget>
class intrusive_ptr {
//...
template <typename, typename...>
friend class pybind11::class_;
private:
intrusive_ptr(TTarget*) {}
}
gives error when I am trying to use it in windows:
C:\Users\circleci\project\build\win_tmp\bin\sccache-cl.exe /TP -DIDEEP_USE_MKL -DMINIZ_DISABLE_ZIP_READER_CRC32_CHECKS -DONNXIFI_ENABLE_EXT=1 -DONNX_ML=1 -DONNX_NAMESPACE=onnx_torch -DTH_BLAS_MKL -DUSE_EXTERNAL_MZCRC -DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_DEPRECATE=1 -D_OPENMP_NOFORCE_MANIFEST -Dcaffe2_pybind11_state_EXPORTS -Iaten\src -I..\aten\src -I. -I..\ -I..\cmake\..\third_party\benchmark\include -Icaffe2\contrib\aten -I..\third_party\onnx -Ithird_party\onnx -I..\third_party\foxi -Ithird_party\foxi -Icaffe2\aten\src\TH -I..\aten\src\TH -Icaffe2\aten\src -I..\aten\..\third_party\catch\single_include -I..\aten\src\ATen\.. -Icaffe2\aten\src\ATen -I..\third_party\miniz-2.0.8 -I..\caffe2\core\nomnigraph\include -I..\torch\csrc\api -I..\torch\csrc\api\include -I..\c10\.. -Ithird_party\ideep\mkl-dnn\include -I..\third_party\ideep\mkl-dnn\src\..\include -Ithird_party\gloo -I..\cmake\..\third_party\gloo -I..\cmake\..\third_party\googletest\googlemock\include -I..\cmake\..\third_party\googletest\googletest\include -I..\third_party\protobuf\src -Iwin_tmp\mkl\include -I..\third_party -I..\cmake\..\third_party\eigen -IC:\Jenkins\Miniconda3\include -IC:\Jenkins\Miniconda3\lib\site-packages\numpy\core\include -I..\cmake\..\third_party\pybind11\include -I..\third_party\ideep\mkl-dnn\include -I..\third_party\ideep\include /DWIN32 /D_WINDOWS /GR /EHsc /w /bigobj -openmp:experimental -DNDEBUG -DUSE_FBGEMM -DUSE_VULKAN_WRAPPER -DHAVE_AVX_CPU_DEFINITION -DHAVE_AVX2_CPU_DEFINITION /MD /O2 /Ob2 /DNDEBUG /w /bigobj -DNDEBUG -DCAFFE2_USE_GLOO -DUSE_GCC_GET_CPUID -DUSE_AVX -DUSE_AVX2 -DTH_HAVE_THREAD /EHsc /DNOMINMAX /wd4267 /wd4251 /wd4522 /wd4838 /wd4305 /wd4244 /wd4190 /wd4101 /wd4996 /wd4275 /bigobj -std:c++14 /showIncludes /Focaffe2\CMakeFiles\caffe2_pybind11_state.dir\python\pybind_state_ideep.cc.obj /Fdcaffe2\CMakeFiles\caffe2_pybind11_state.dir\ /FS -c ..\caffe2\python\pybind_state_ideep.cc
..\cmake\..\third_party\pybind11\include\pybind11/pybind11.h(880): error C3855: 'pybind11::class_': template parameter '<unnamed-symbol>' is incompatible with the declaration
..\cmake\..\third_party\pybind11\include\pybind11/pybind11.h(880): error C2976: 'pybind11::class_': too few template arguments
..\c10/util/intrusive_ptr.h(10): note: see declaration of 'pybind11::class_'
..\cmake\..\third_party\pybind11\include\pybind11/pybind11.h(1527): error C2955: 'pybind11::class_': use of class template requires template argument list
..\cmake\..\third_party\pybind11\include\pybind11/pybind11.h(1030): note: see declaration of 'pybind11::class_'
..\cmake\..\third_party\pybind11\include\pybind11/pybind11.h(1568): note: see reference to class template instantiation 'pybind11::enum_<Type>' being compiled