1// Copyright (c) 2016-2024 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/core.hpp>
7
8int main() {
9 struct nested { int i; char data[20]; };
10 struct foo { int i; char c; nested n; };
11 static_assert(boost::pfr::tuple_size_v<foo> == 3, "");
12
13 struct with_reference { int& i; char data; };
14 static_assert(boost::pfr::tuple_size_v<with_reference> == 2, "");
15
16 struct empty {};
17 static_assert(boost::pfr::tuple_size_v<empty> == 0, "");
18}
19
20

source code of boost/libs/pfr/test/core/run/tuple_size.cpp