Check out example codes for "variant hold type". It will help you in understanding the concepts better.

Code Example 1

template<typename T, typename VARIANT_T>
struct variant_member;

template<typename T, typename... ALL_T>
struct variant_member<T, std::variant<ALL_T...>> 
  : public std::disjunction<std::is_same<T, ALL_T>...> {};
  
// Using as: variant_member<TYPE, VARIANT>::value

Learn ReactJs, React Native from akashmittal.com