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 class test_with_protected { 9 protected: 10 int i; 11 char c; 12 13 public: 14 double d; 15 float f; 16 }; 17 main()18int main() { 19 #ifndef __cpp_lib_is_aggregate 20 // TODO: No known way to detect protected fields 21 # error No known way to detect protected fields. 22 #endif 23 24 return boost::pfr::tuple_size<test_with_protected>::value; 25 } 26 27