cppx-core
cppx-core
language
syntax
macro-use.hpp
Go to the documentation of this file.
1
#pragma once // Source encoding: UTF-8 with BOM (π is a lowercase Greek "pi").
2
14
15
#include <
cppx-core/meta-macro/macro-apply_with_fixed_arg.hpp
>
16
17
#ifndef CPPX_NO_DOLLARS_PLEASE
18
# define $use_from_namespace CPPX_USE_FROM_NAMESPACE
19
# define $use_cppx CPPX_USE_CPPX
20
# define $use_std CPPX_USE_STD
21
# define $use_namespace_name_in CPPX_USE_NAMESPACE_NAME_IN
22
# define $use_cppx_namespace_name CPPX_USE_CPPX_NAMESPACE_NAME
23
# define $use_std_namespace_name CPPX_USE_STD_NAMESPACE_NAME
24
# define $use_namespace_names_in CPPX_USE_NAMESPACE_NAMES_IN
25
# define $use_cppx_namespace_names CPPX_USE_CPPX_NAMESPACE_NAMES
26
# define $use_std_namespace_names CPPX_USE_STD_NAMESPACE_NAMES
27
#endif
28
34
#define CPPX_USE_FROM_NAMESPACE( ns, ... ) \
35
CPPX_APPLY_WITH_FIXED_ARG( CPPX_GENERATE_USING_DECLARATION_FOR, ns, __VA_ARGS__ ) \
36
static_assert( !!"Terminate this statement with a semicolon" )
37
39
#define CPPX_GENERATE_USING_DECLARATION_FOR( ns, name ) \
40
using ns::name;
41
46
#define CPPX_USE_CPPX( ... ) \
47
CPPX_USE_FROM_NAMESPACE( cppx, __VA_ARGS__ )
48
52
#define CPPX_USE_STD( ... ) \
53
CPPX_USE_FROM_NAMESPACE( std, __VA_ARGS__ )
54
59
#define CPPX_USE_NAMESPACE_NAME_IN( parent_ns, nested_ns ) \
60
namespace nested_ns = parent_ns::nested_ns
61
65
#define CPPX_USE_CPPX_NAMESPACE_NAME( nested_ns ) \
66
CPPX_USE_NAMESPACE_NAME_IN( cppx, nested_ns )
67
71
#define CPPX_USE_STD_NAMESPACE_NAME( nested_ns ) \
72
CPPX_USE_NAMESPACE_NAME_IN( std, nested_ns )
73
79
#define CPPX_USE_NAMESPACE_NAMES_IN( parent_ns, ... ) \
80
CPPX_APPLY_WITH_FIXED_ARG( CPPX_GENERATE_NAMESPACE_NAME_USAGE, parent_ns, __VA_ARGS__ ) \
81
static_assert( !!"Terminate this statement with a semicolon" )
82
84
#define CPPX_GENERATE_NAMESPACE_NAME_USAGE( parent_ns, nested_ns ) \
85
namespace nested_ns = parent_ns::nested_ns;
86
91
#define CPPX_USE_CPPX_NAMESPACE_NAMES( ... ) \
92
CPPX_USE_NAMESPACE_NAMES_IN( cppx, __VA_ARGS__ )
93
97
#define CPPX_USE_STD_NAMESPACE_NAMES( ... ) \
98
CPPX_USE_NAMESPACE_NAMES_IN( std, __VA_ARGS__ )
macro-apply_with_fixed_arg.hpp
For each of the max 63 specified second arguments $apply_with_fixed_arg invokes the specified two-arg...
Generated by
1.8.15