lockblox / multihash

C++ Implementation of Multihash
MIT License
10 stars 2 forks source link

std::enable_if_t<std::is_same_v< varint::detail::static_extent_t, typename varint::detail::extent_type<Container>::type> #5

Open adaiyuagua opened 2 years ago

adaiyuagua commented 2 years ago

I encountered some problems in building. It looks like varint is incompatible at function entry, as follows:

/* Creates a multihash from components / template multihash(typename std::enable_if_t< std::is_same_v< varint::detail::static_extent_t, typename varint::detail::extent_type::type> && std::is_same_v<T, Container>, code_type> code, std::string_view digest, T data);

/* Creates a multihash from components / template multihash(typename std::enable_if_t< std::is_same_v< varint::detail::dynamic_extent_t, typename varint::detail::extent_type::type> && std::is_convertible_v<T, std::string_view>, code_type> code, T digest);

the “extent_type.h” is that:

struct dynamic_extent_t {}; struct static_extent_t {};

template <typename Container, typename = void> class extent_type { public: using type = static_extent_t; };

template class extent_type<Container, std::void_t<decltype(std::declval().push_back( std::declval()))>> { public: using type = dynamic_extent_t;

errors: 严重性 代码 说明 项目 文件 行 禁止显示状态 错误 C2938 “std::enable_if_t<false,multihash::code_type>”: 未能使别名模板专用化 (编译源文件 multihash_test.cpp)
错误 C2610 “multihash::multihash &multihash::multihash::operator =(const multihash::multihash &)”: 不是可默认为的特殊成员函数 (编译源文件 multihash_test.cpp) 错误 C2440 “初始化”: 无法从“initializer list”转换为“test::multihash_test::multihash_string” multihash_test

I've been stuck here for a long time. And I'd appreciate it if you could help me!!

markovchainy commented 2 years ago

Hi, what compiler version are you using?