Subject: [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: 2016-03-23 15:08:58
#12092: Request: allow std::tuple typelists in BOOST_AUTO_TEST_CASE_TEMPLATE()
-------------------------------------------------+-------------------------
Reporter: Tony Lewis <tonyelewis@â¦> | Owner: rogeeff
Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: test
Version: Boost 1.61.0 | Severity:
Keywords: | Optimization
test,tuple,mpl,vector,c++11,typelists |
-------------------------------------------------+-------------------------
At present, `BOOST_AUTO_TEST_CASE_TEMPLATE` requires a Boost MPL sequence
type to specify the list of types.
Please may I request that this be extended under >= C++11 compilation to
also support a `std::tuple<...>` type as a way of specifying the types?
I think this would be a good addition because I get the sense that
`std::tuple` is increasingly being preferred as a way to specify typelists
(because it's standard, because it allows an arbitrary number of types
out-of-the-box and because it doesn't use dummy placeholder types for
absent types and so generates much simpler compiler errors).
Under the covers, this could just be implemented by converting to, say an
equivalent`boost::mpl::vector`. This isn't too onerous under modern C++ :
{{{
#!cpp
template <typename... Ts>
boost::mpl::vector<Ts...> mpl_vector_of_tuple_impl_fn(const
std::tuple<Ts...> &);
template <typename T>
using mpl_vector_of_tuple_t = decltype( mpl_vector_of_tuple_impl_fn(
std::declval<T>() ) );
}}}
...which can then be used like:
{{{
#!cpp
using example_int_char_mpl_vec = mpl_vector_of_tuple_t< std::tuple< int,
char > >;
}}}
I don't mind if users have to specify a different name (other than
`BOOST_AUTO_TEST_CASE_TEMPLATE`) when using `std::tuple`.
Thanks very much for your time.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/12092> 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 : 2017-02-16 18:50:19 UTC