add tag
Jonathan Mee
Visual Studio 2019 only supports [a portion of the Library Fundamentals](https://docs.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance?view=vs-2019), notably not `is_detected`. Is there a cross-platform implementation available?
Top Answer
Jonathan Mee
A possible implementation of `std::experimental::is_detected` is available here: https://en.cppreference.com/w/cpp/experimental/is_detected#Possible_implementation

That can even be pared down to something as simple as:

```
namespace detail {
template <class AlwaysVoid, template<class...> class Op, class... Args>
struct detector {
    using value_t = std::false_type;
};

template <template<class...> class Op, class... Args>
struct detector<std::void_t<Op<Args...>>, Op, Args...> {
    using value_t = std::true_type;
};
} // namespace detail

template <template<class...> class Op, class... Args>
using is_detected = typename detail::detector<void, Op, Args...>::value_t;

template <template<class...> class Op, class... Args>
const auto is_detected_v = is_detected<Op, Args...>::value;
```

For example [this](https://coliru.stacked-crooked.com/a/bf4610faee27d420) also works on Visual Studio 2017 and latter.

This room is for discussion about this question.

Once logged in you can direct comments to any contributor here.

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.