mirror of
https://github.com/boostorg/system.git
synced 2026-07-06 00:11:07 +02:00
Members with initializers make a class non-aggregate in C++11
This commit is contained in:
@@ -6,21 +6,7 @@
|
||||
#include <boost/system/result.hpp>
|
||||
#include <boost/core/lightweight_test_trait.hpp>
|
||||
#include <boost/config/pragma_message.hpp>
|
||||
|
||||
struct X
|
||||
{
|
||||
int v;
|
||||
};
|
||||
|
||||
struct Y
|
||||
{
|
||||
X x1{}, x2{}, x3{}, x4{};
|
||||
};
|
||||
|
||||
struct E
|
||||
{
|
||||
int w;
|
||||
};
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#if !defined(BOOST_SYSTEM_HAS_BUILTIN_IS_AGGREGATE) && !( defined(__cpp_lib_is_aggregate) && __cpp_lib_is_aggregate >= 201703L )
|
||||
|
||||
@@ -29,6 +15,32 @@ int main() {}
|
||||
|
||||
#else
|
||||
|
||||
struct X
|
||||
{
|
||||
int v;
|
||||
};
|
||||
|
||||
struct E
|
||||
{
|
||||
int w;
|
||||
};
|
||||
|
||||
#if BOOST_CXX_VERSION >= 201402L
|
||||
|
||||
struct Y
|
||||
{
|
||||
X x1{}, x2{}, x3{}, x4{};
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
struct Y
|
||||
{
|
||||
X x1, x2, x3, x4;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
using namespace boost::system;
|
||||
|
||||
int main()
|
||||
|
||||
Reference in New Issue
Block a user