我试图在visual studio中编译webrtc代码并且遇到了这个错误(来自type_traits.h)。代码是:
// Determines if the given class has zero-argument .data() and .size() methods
// whose return values are convertible to T* and size_t, respectively.
template <typename DS, typename T>
class HasDataAndSize {
private:
template <
typename C,
typename std::enable_if<
std::is_convertible<decltype(std::declval<C>().data()), T*>::value &&
std::is_convertible<decltype(std::declval<C>().size()), std::size_t>::value>::type* = nullptr>
static int Test(int);
template <typename>
static char Test(...);
public:
static constexpr bool value = std::is_same<decltype(Test<DS>(0)), int>::value;
};
错误是:
错误C2228左边的&#39; .data&#39;必须有class / struct / union
答案 0 :(得分:0)
将visual studio 2015更新到更新3解决了这个问题。