- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If someone has access to some more official bug reporting mechanism, I'd appreciate if you filed a bug report about this: (using Intel C++ Composer XE 2013 [v.13.0.089] on Windows)
[cpp]
#include <type_traits>
template <typename T, int guid, typename Enable = void>
struct has_type_guid
: std::false_type
{};
template <typename T, int guid>
struct has_type_guid< T, guid, typename std::enable_if<T::_type_guid == guid>::type>
: std::true_type
{};
struct MyStruct
{
template <typename T, int guid, typename Enable>
friend struct has_type_guid;
private:
enum { _type_guid = 42 };
};
int main()
{
static_assert(has_type_guid<MyStruct, 42>::value, "");
return 0;
}
// Test.cpp(30): error : static assertion failed with ""
// static_assert(has_type_guid<MyStruct, 42>::value, "");
// ^
[/cpp]
EDIT:
Although, I'm not so sure anymore that this is a bug, since GCC 4.7.1 doesn't compile the code either (complaining that "MyStruct::_type_guid is private"). Microsoft Visual C++ 11.0 compiles it just fine though.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page