Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
std::experi...ectSequence(3)  C++ Standard Libary std::experi...ectSequence(3)

NAME
       std::experimental::reflect::ObjectSequence   -	std::experimental::re-
       flect::ObjectSequence

Synopsis
	  Defined in header <experimental/reflect>
	  template< class T >					   (reflection
       TS)
	  concept ObjectSequence = Object<T> &&	/* see below */;

	  The  ObjectSequence  concept	is  satisfied  by meta-object sequence
       types.

	  A meta-object	sequence type is a meta-object type that  is  obtained
       from a
	  meta-object  operation that generates	a sequence, e.g. get_data_mem-
       bers. Each element
	  of a meta-object sequence type is a meta-object type.

Example
       // Run this code

	#include<cmath>
	#include<experimental/reflect>
	#include<tuple>
	#include<type_traits>

	namespace reflect = std::experimental::reflect;

	template<reflect::Typed... Ms>
	using tuple_from_seq_t = std::tuple<reflect::get_reflected_type_t<
	    reflect::get_type_t<Ms>>...>;

	template<reflect::Record T>
	using collect_tuple = reflect::unpack_sequence_t<
	    tuple_from_seq_t,
	    reflect::get_data_members_t<T>>;

	int main()
	{
	    static_assert(reflect::ObjectSequence<
			      reflect::get_data_members<re-
       flexpr(std::div_t)>>, "");
	    static_assert(std::is_same<collect_tuple<reflexpr(std::div_t)>,
				       std::tuple<int, int>>::value, "");
	}

See also
	   This	section	is incomplete
	   Reason: templatization

Category:
	    * Todo with	reason

http://cppreference.com		  2024.06.10	  std::experi...ectSequence(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=std::experimental::reflect::ObjectSequence&sektion=3&manpath=FreeBSD+Ports+15.1.quarterly>

home | help