0

I'm compiling openVolumeMesh on visual studio 2017 using c++17, and it reports an internal compiler error in header "OpenVolumeMesh/IO/detail/ovmb_format.hh". I make a minimal reproduction here:

#include <stdint.h>

enum class IntEncoding : uint8_t {
    None = 0,
    U8 = 1,
    U16 = 2,
    U32 = 4,
};
// ... 
struct TopoEntity;
struct TopoType;
struct FileHeader;
// ...

template<typename T>
extern size_t ovmb_size;
template<> inline size_t ovmb_size<IntEncoding> = 1;
template<> inline size_t ovmb_size<TopoType> = 1;
template<> inline size_t ovmb_size<FileHeader> =
        //+ sizeof(FileHeader::file_version)
        //+ sizeof(FileHeader::header_version)
        //+ sizeof(FileHeader::vertex_dim)
        + ovmb_size<TopoType>   /* if delete this line, it passes the compilation*/ 
        + 4 
        + 4 * sizeof(uint64_t);
// ***

I'm guessing that the variable template specialization does not support recursive definition, is it true? if not, what's the problem in the above code

Nolazuck
  • 81
  • 4

0 Answers0