1 // Copyright (c) 2018-2021 Antony Polukhin 2 // 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) 5 6 #include <boost/pfr/tuple_size.hpp> 7 8 #ifdef __clang__ 9 # pragma clang diagnostic ignored "-Wunused-private-field" 10 #endif 11 12 13 class test_with_private { 14 private: 15 int i; 16 char c; 17 18 public: 19 double d; 20 float f; 21 }; 22 main()23int main() { 24 #ifndef __cpp_lib_is_aggregate 25 # error No known way to detect private fields. 26 #endif 27 28 return boost::pfr::tuple_size<test_with_private>::value; 29 } 30 31