Commit 83d4d4e4 authored by Robert Maynard's avatar Robert Maynard
Browse files

ArrayPortalToIterators now compiles with GCC-4.X

The draft C++11 spec that GCC-4.X implemented against had some
defects that made implementing void_t<...> tricky.
parent 90afd1ef
......@@ -15,12 +15,26 @@
namespace vtkmstd
{
/// Implementation of std::void_t (C++17):
/// Allows for specialization of class templates based on members of template
/// parameters.
#if defined(VTKM_GCC) && (__GNUC__ < 5)
// Due to a defect in the wording (CWG 1558) unused parameters in alias templates
// were not guaranteed to ensure SFINAE, and therefore would consider everything
// to match the 'true' side. For VTK-m the only known compiler that implemented
// this defect is GCC < 5.
template <class... T>
struct void_pack
{
using type = void;
};
template <class... T>
using void_t = typename void_pack<T...>::type;
#else
template <typename...>
using void_t = void;
#endif
} // end namespace vtkmstd
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment