Re: [Boost-bugs] [Boost C++ Libraries] #12092: Request: allow std::tuple typelists in BOOST_AUTO_TEST_CASE_TEMPLATE()

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #12092: Request: allow std::tuple typelists in BOOST_AUTO_TEST_CASE_TEMPLATE()
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2018-01-23 14:23:00


#12092: Request: allow std::tuple typelists in BOOST_AUTO_TEST_CASE_TEMPLATE()
-------------------------------------+-------------------------------------
  Reporter: Tony Lewis | Owner: Raffi Enficiaud
  <tonyelewis@…> |
      Type: Feature Requests | Status: closed
 Milestone: Boost 1.67.0 | Component: test
   Version: Boost 1.61.0 | Severity: Optimization
Resolution: fixed | Keywords:
                                     | test,tuple,mpl,vector,c++11,typelists
-------------------------------------+-------------------------------------

Comment (by Tony E Lewis <tonyelewis@…>):

 Thanks very much for this.

 As I now understand it, the TMP gurus avoid using `std::tuple` as a
 typelist because it has complex guts that needlessly eat up compiler-time
 for each instantiation. Instead, I think they typically just use an
 arbitrary empty template struct, eg:

 {{{
 #!cpp
 template <typename...> struct my_typelist_wrapper {};

 using a_typelist = my_typelist_wrapper<int, char>;
 }}}

 With this in mind, it might be nice to consider finessing the conversion
 to `mpl::vector` so that it works from any arbitrary such typelist
 (including `std::tuple`) :

 {{{
 #!cpp
 template <template <typename...> class U,
           typename... Ts>
 boost::mpl::vector<Ts...> mpl_vector_of_typelist_impl_fn(const U<Ts...>
 &);

 template <typename T>
 using mpl_vector_of_typelist_t = decltype( mpl_vector_of_typelist_impl_fn(
 std::declval<T>() ) );
 }}}

 I'm sorry that I didn't suggest this earlier.

-- 
Ticket URL: <https://svn.boost.org/trac10/boost/ticket/12092#comment:7>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2018-01-23 14:33:54 UTC