2 // Copyright 2009 Daniel James.
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)
7 \class example::example
9 \brief Documentation for class example
11 Detailed documentation
14 void class_code_sample();
21 \brief Documentation for macro example
25 static int global_static_integer;
26 const int global_const_integer = 1;
27 static const int global_static_const_integer = 2;
28 enum global_enum { enumerator1 = 1, enumerator2 };
34 \param x Parameter description.
37 void function_code_sample();
40 void free_function(int x);
42 int namespace_integer;
43 static int namespace_static_integer;
44 const int namespace_const_integer = 1;
45 static const int namespace_static_const_integer = 2;
46 enum namespace_enum { enumerator };
51 example(example const&) = default;
52 example& operator=(example const&) = delete;
53 virtual int virtual_method();
54 virtual int virtual_abstract_method() = 0;
55 virtual int virtual_const_method() const;
56 int method_with_default_value(int = default_value);
58 int method_with_fp(int (*fp)(), volatile char);
59 int method_with_string_default1(char* = ")", volatile char);
60 int method_with_string_default2(char* = "(", volatile char);
61 int method_with_char_default1(char = '(', volatile char);
62 int method_with_char_default2(char = ')', volatile char);
64 int volatile_method_with_fp(int (*fp)(), volatile char) volatile;
65 int volatile_method_with_string_default1(char* = ")", volatile char) volatile;
66 int volatile_method_with_string_default2(char* = "(", volatile char) volatile;
67 int volatile_method_with_char_default1(char = '(', volatile char) volatile;
68 int volatile_method_with_char_default2(char = ')', volatile char) volatile;
70 void const_method() const;
71 void volatile_method() volatile;
73 void trad_noexcept() noexcept;
74 void trad_noexcept_if() noexcept(a == b && (c || d));
75 void boost_noexcept() BOOST_NOEXCEPT;
76 void boost_noexcept_if() BOOST_NOEXCEPT_IF(a == b && (c || d));
78 void trad_constexpr() constexpr;
79 void boost_constexpr() BOOST_CONSTEXPR;
80 void boost_constexpr_or_const() BOOST_CONSTEXPR_OR_CONST;
82 void constexpr_noexcept() constexpr noexcept;
84 static int static_method();
85 static int static_constexpr() constexpr;
88 static int static_integer;
89 mutable int mutable_integer;
90 const int const_integer;
91 static const int static_const_integer;
93 // Visual check of typedef alignment.
94 /** This type has documentation. */
95 typedef int documented_type1;
96 /** \brief This type has documentation. */
97 typedef long documented_type2;
98 /** This type has documentation. */
99 typedef long double documented_type3;
100 typedef short undocumented_type1;
101 typedef double undocumented_type2;
108 enum class_enum { enumerator };
111 enum internal_enum { internal_enumerator };
113 explicit operator int();
115 int protected_integer;
116 static int protected_static_integer;
117 mutable int protected_mutable_integer;
118 const int protected_const_integer;
119 static const int protected_static_const_integer;
121 enum protected_class_enum { enumerator2 };
124 static int private_static_integer;
125 mutable int private_mutable_integer;
126 const int private_const_integer;
127 static const int private_static_const_integer;
129 enum private_class_enum { enumerator3 };
133 * Test some doxygen markup
135 * \warning This is just an example.
137 * Embedded docbook list:
140 * <orderedlist><listitem><simpara>1</simpara></listitem><listitem><simpara>2</simpara></listitem></orderedlist>
143 * \a Special \b Bold \c Typewriter \e Italics \em emphasis \p parameter
145 * \arg Arg1 first argument.
146 * \arg Arg2 second argument.
148 * \li First list item.
149 * \li Second list item
165 * Alternative way of writing code, has a complicated workaround
166 * because doxygen treats the empty line as a paragraph
175 * Unfortunately the workaround will merge consecutive blocks,
186 * \tparam TypeParameter A template parameter
187 * \tparam NonTypeParameter This is a non-type template parameter
188 * \tparam TypeParameterWithDefault This is a template parameter with a default argument
191 template <typename TypeParameter, int NonTypeParameter,
192 typename TypeParameterWithDefault = int>
193 struct example_template {};
196 * \param i A function parameter
201 * This is a test function.
202 * \ref example::example "Link to class"
203 * \ref example_template "Link to class template"
204 * \note This is a note.
206 * \see example::example and example_template
208 int namespace_func(int i, int j);
211 * Testing a function template.
212 * \tparam TypeParameter A template parameter
213 * \tparam NonTypeParameter This is a non-type template parameter
215 template <typename TypeParameter, int NonTypeParameter>
216 void namespace_func_template();
219 struct specialization_test {
223 struct specialization_test<T*> {
224 /** A constructor. */
225 specialization_test();
227 ~specialization_test();
228 /** An assignment operator. */
229 detail::unspecified& operator=(const specialization_test&);
233 #define EXAMPLE(m) The macro