Handy wrapper for aggregates to use with emplace*() container's member functions:#include <type_traits>#include <utility>template< typename type >struct aggregate_wrapper    : type{    aggregate_wrapper() = default;    template< typename ...arguments,              bool is_noexcept = noexcept(::new (std::declval< void * >()) type{std::declval< arguments >()...}) >    constexpr    aggregate_wrapper(arguments &&... _arguments) noexcept(is_noexcept)        : type{std::forward< arguments >(_arguments)...}    { ; }};#include <vector>#include <cassert>#include <cstdlib>int main(){    struct A {};    struct B {};    struct S { A & a; B & b; };    A a; B b;    std::vector< aggregate_wrapper< S > > v;    v.emplace_back(a, b);    S & s = v.back(); // implicitly convertible to S    assert(&s.a == &a);    assert(&s.b == &b);    v.pop_back();    v.push_back({a, b}); // (implicitly?) copy-constructible    assert(&v.back().a == &a);    assert(&v.back().b == &b);    return EXIT_SUCCESS;}aggregate_wrapper< T > mimics T in sense of special functions available (copy/move-constructors/assignment operators and destructor). All public data memebers are available via operator . as well.It is possible to provide incomplete list of public data member initializers to constructor, but in such a case compiler's warning will be here (default data member initializers for omitted data members can solve the problem (C++14 feature)).There is very comprehensive test for this wrapper.What are there design flaws (maybe there is issue with explicit?)?
Aggregate wrapper
c++;c++11;c++14