Skip to content

Parsing

Demonstration and test of some parsing capabilities, including basics such as variables, functions, operators and types, and more complex forms such as elaborate templates and SFINAE.

Types

Name Description
Class Test class.
ClassTemplate Test class template.
ClassTemplateWithMembers Class template with members.
ClassWithMembers Class with members.
Enum Test enumeration.
EnumAfter Test enumeration with values documented after.
EnumClass Test scoped enumeration.
EnumStruct Test scoped enumeration.
ForwardClass Forward class declaration.
Struct Test struct.
StructTemplate Test struct template.
TypeAlias Test type alias.
TypeAliasTemplate Test type alias template.
TypeDef Test typedef.
Union Test union.
UnionTemplate Test union template.

Concepts

Name Description
Concept Test concept.
TrivialConcept Test trivial concept.

Macros

Name Description
MACRO Test macro.
MACRO_AFTER Test macro, documented after entity with /// comment
MACRO_WITH_ARGS Test macro with arguments.
MACRO_WITH_ARGS_AFTER Test macro with arguments, documented after entity with /// comment

Variables

Name Description
a Documented with /** ... */ style preceding comment.
arr1 Test variable of array type.
arr2 Test variable of array type with initializer.
b Documented with /// style preceding comment.
c Documented with /// style preceding comment that wraps across multiple lines and has multiple paragraphs.
d Documented after entity with /// comment
e Documentation comment with * and / characters.
ptr1 Test variable of pointer type.
ptr2 Test variable of pointer type with initializer.
ref1 Test variable of reference type.
ref2 Test variable of reference type with initializer.
w Test variable.
whitespace1 Comment where leading whitespace is important, using /** ... */ style preceding comment.
whitespace2 Comment where leading whitespace is important, using /// style preceding comment.
x Test variable with initializer.
y Test variable with parenthetical initializer.
z Test variable with brace initializer.
λ Test variable with unicode character.

Operators

Name Description
operator+ Test operator.
operator+ Test operator template.
operator+ Test operator template with SFINAE.
operator+ Test inline operator.
operator+ Test inline operator template.
operator+ Test inline operator template with SFINAE.

Functions

Name Description
f Test function.
f Test function that returns a reference.
f Test function that returns a pointer.
f Test function template.
f Test function template with SFINAE.
f Test inline function.
f Test inline function template.
f Test inline function template with SFINAE.

Concept Details

Concept

template<class T> concept Concept = std::is_arithmetic_v<T>

Test concept.

TrivialConcept

template<class T> concept TrivialConcept = true

Test trivial concept.

Macro Details

MACRO

#define MACRO

Test macro.

MACRO_AFTER

#define MACRO_AFTER

Test macro, documented after entity with /// comment

MACRO_WITH_ARGS

#define MACRO_WITH_ARGS(x, y)

Test macro with arguments.

MACRO_WITH_ARGS_AFTER

#define MACRO_WITH_ARGS_AFTER(x, y)

Test macro with arguments, documented after entity with /// comment

Variable Details

a

int a

Documented with /** ... */ style preceding comment.

arr1

int arr1[10]

Test variable of array type.

arr2

int arr2[10]

Test variable of array type with initializer.

b

int b

Documented with /// style preceding comment.

c

int c

Documented with /// style preceding comment that wraps across multiple lines and has multiple paragraphs.

This is the second paragraph.

This is the third paragraph.

d

int d

Documented after entity with /// comment

e

int e

Documentation comment with * and / characters.

ptr1

int* ptr1

Test variable of pointer type.

ptr2

int* ptr2

Test variable of pointer type with initializer.

ref1

int& ref1

Test variable of reference type.

ref2

int& ref2

Test variable of reference type with initializer.

w

int w

Test variable.

whitespace1

int whitespace1

Comment where leading whitespace is important, using /** ... */ style preceding comment. Details should show code if indenting is correctly preserved.

int main();

whitespace2

int whitespace2

Comment where leading whitespace is important, using /// style preceding comment. Details should show code if indenting is correctly preserved.

int main();

x

int x

Test variable with initializer.

y

int y

Test variable with parenthetical initializer.

z

int z

Test variable with brace initializer.

λ

int λ

Test variable with unicode character.

Operator Details

operator+

int operator+(int x, int y)

Test operator.

template<class T> T operator+(T x, T y)

Test operator template.

template<class T, std::enable_if_t<std::is_integral_v<T>, int> = 0> T operator+(T x, T y)

Test operator template with SFINAE.

inline int operator+(int x, int y)

Test inline operator.

template<class T> T operator+(T x, T y)

Test inline operator template.

template<class T, std::enable_if_t<std::is_integral_v<T>, int> = 0> T operator+(T x, T y)

Test inline operator template with SFINAE.

Function Details

f

int f(int x, int y)

Test function.

int& f(int x, int y)

Test function that returns a reference.

int* f(int x, int y)

Test function that returns a pointer.

template<class T> T f(T x, T y)

Test function template.

template<class T, std::enable_if_t<std::is_integral_v<T>, int> = 0> T f(T x, T y)

Test function template with SFINAE.

inline int f(int x, int y)

Test inline function.

template<class T> T f(T x, T y)

Test inline function template.

template<class T, std::enable_if_t<std::is_integral_v<T>, int> = 0> T f(T x, T y)

Test inline function template with SFINAE.