]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/preprocessor/doc/examples/catch_builtin.cpp
1 # /* Copyright (C) 2002
3 # * http://www.housemarque.com
5 # * Distributed under the Boost Software License, Version 1.0. (See
6 # * accompanying file LICENSE_1_0.txt or copy at
7 # * http://www.boost.org/LICENSE_1_0.txt)
10 # /* Revised by Paul Mensonides (2002) */
12 # /* See http://www.boost.org for most recent version. */
14 # /* This example demonstrates the usage of lists and BOOST_PP_LIST_FOR_EACH(). */
19 # include <boost/preprocessor/list/for_each.hpp>
20 # include <boost/preprocessor/tuple/to_list.hpp>
22 # /* List of built-in types. (Strictly speaking wchar_t should be on the list.) */
24 # define BUILTIN_TYPES \
25 BOOST_PP_TUPLE_TO_LIST( \
29 char, signed char, unsigned char, \
30 unsigned short, short, \
32 long, unsigned long, \
39 # define CATCH(R, _, T) \
41 std::cerr << "Caught an " << typeid(t).name() << " = " << t; \
49 BOOST_PP_LIST_FOR_EACH(CATCH
, _
, BUILTIN_TYPES
)