2
0
mirror of https://github.com/boostorg/pfr.git synced 2026-01-19 04:22:13 +00:00
Files
pfr/test/common/protected_fields.cpp
Antony Polukhin ee7a716b6d Update copyrights
2018-06-02 12:21:56 +03:00

32 lines
661 B
C++

// Copyright (c) 2018 Antony Polukhin
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/pfr/flat/tuple_size.hpp>
#include <boost/pfr/precise/tuple_size.hpp>
class test_with_protected {
protected:
int i;
char c;
public:
double d;
float f;
};
int main() {
#ifdef BOOST_PFR_TEST_FLAT
return boost::pfr::flat_tuple_size<test_with_protected>::value;
#else
#ifndef __cpp_lib_is_aggregate
# error No known way to detect protected fields.
#endif
return boost::pfr::tuple_size<test_with_protected>::value;
#endif
}