1 // Copyright (c) 2019-2020 Antony Polukhin
3 // Distributed under the Boost Software License, Version 1.0. (See accompanying
4 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 #include <boost/pfr/core.hpp>
11 struct unconstrained_template
{
12 unconstrained_template() = default;
13 unconstrained_template(const unconstrained_template
&) = default;
14 unconstrained_template(unconstrained_template
&&) = default;
15 unconstrained_template
& operator=(const unconstrained_template
&) = default;
16 unconstrained_template
& operator=(unconstrained_template
&&) = default;
19 constexpr unconstrained_template(const U
& val
)
31 struct aggregate_unconstrained
{
32 unconstrained_template
<int> a
;
33 unconstrained_template
<int_element
> b
;
37 using sanity
= decltype(aggregate_unconstrained
{
38 boost::pfr::detail::ubiq_lref_constructor
{0},
39 boost::pfr::detail::ubiq_lref_constructor
{1},
43 sanity
, aggregate_unconstrained
45 "Precise reflection with template constructors sanity check fails"
48 boost::pfr::detail::enable_if_constructible_helper_t
<aggregate_unconstrained
, 2> foo
;
53 boost::pfr::tuple_element_t
<0, aggregate_unconstrained
>,
54 unconstrained_template
<int>
56 "Precise reflection with template constructors fails to work"
61 boost::pfr::tuple_element_t
<1, aggregate_unconstrained
>,
62 unconstrained_template
<int_element
>
64 "Precise reflection with template constructors fails to work"
67 aggregate_unconstrained aggr
{3, 4};
68 return boost::pfr::get
<1>(aggr
).value_
.value_
- 4;