pputl
0.2.1
pputl Preprocessor Utilities
master
pputl
include
pputl
first.h
Go to the documentation of this file.
1
#
ifndef
PPUTL_FIRST_H_INCLUDED
2
#
define
PPUTL_FIRST_H_INCLUDED
3
#
///// c++20
4
#
///////////////////////////////////////////////////////////////////////////////
5
#
/// @brief \link PPUTL_FIRST PPUTL_FIRST\endlink -
6
#
/// return the first passed argument
7
#
/// @file
8
#
// __ ___
9
#
// /\ \__/\_ \
10
#// _____ _____ __ __\ \ ,_\//\ \
11
#// /\ '__`\/\ '__`\/\ \/\ \\ \ \/ \ \ \
12
#// \ \ \_\ \ \ \_\ \ \ \_\ \\ \ \_ \_\ \_
13
#
// \ \ ,__/\ \ ,__/\ \____/ \ \__\/\____\
14
#// \ \ \ \ \ \ \/___/ \/__/\/____/
15
#
// \/_/ \/_/
16
#
//
17
#
// pputl Preprocessor Utilities
18
#
// Copyright (C) 2020 Justin Collier <m@jpcx.dev>
19
#
//
20
#
// This program is free software: you can redistribute it and/or modify
21
#
// it under the terms of the GNU General Public License as published by
22
#
// the Free Software Foundation, either version 3 of the License, or
23
#
// (at your option) any later version.
24
#
//
25
#
// This program is distributed in the hope that it will be useful,
26
#
// but WITHOUT ANY WARRANTY; without even the internalied warranty of
27
#
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28
#
// GNU General Public License for more details.
29
#
// //
30
#
// You should have received a copy of the GNU General Public License ///
31
#
// along with this program. If not, see <https://www.gnu.org/licenses/>. ////
32
#
///////////////////////////////////////////////////////////////////////////////
33
#
34
#
include
"pputl/cat.h"
35
#
36
#
/// return the first passed argument
37
#
///
38
#
/// @ingroup pputl
39
#
/// @anchor PPUTL_FIRST
40
#
/// @param ... args
41
#
/// @returns first arg
42
#
/// @code
43
#
/// #include <pputl/first.h>
44
#
/// PPUTL_FIRST(); // expands to nothing
45
#
/// PPUTL_FIRST(a); // a
46
#
/// PPUTL_FIRST(a, b); // a
47
#
/// @endcode
48
#
define
PPUTL_FIRST
(
...
)
PPUTL_DETAIL_FIRST_X
(
__VA_ARGS__
)
49
#
50
#
define
PPUTL_DETAIL_FIRST_X
(
...
)
51
PPUTL_DETAIL_FIRST_CHOOSER
(
__VA_OPT__
(
,
)
SIZEY
,
EMPTY
)
(
__VA_ARGS__
)
52
#
define
PPUTL_DETAIL_FIRST_CHOOSER
(
_
,
choice
,
...
)
53
PPUTL_CAT
(
PPUTL_DETAIL_FIRST_
,
choice
)
54
#
define
PPUTL_DETAIL_FIRST_EMPTY
(
)
55
#
define
PPUTL_DETAIL_FIRST_SIZEY
(
_1
,
...
)
_1
56
#
57
#
endif
PPUTL_DETAIL_FIRST_X
#define PPUTL_DETAIL_FIRST_X(...)
Definition:
first.h:50
PPUTL_CAT
#define PPUTL_CAT(...)
Definition:
cat.h:40
Generated by
1.8.18