CNORXZ
Container with Native Operation Routines and Expressions
Loading...
Searching...
No Matches
Macros
macros.h File Reference

useful macros More...

#include <iostream>

Go to the source code of this file.

Macros

#define CHECK   std::cout << __FILE__ << ": @" << __LINE__ << " in " << __func__ << std::endl;
 
#define VCHECK(a)
 
#define DEFAULT_C(__class_name__)   __class_name__() = default
 
#define DEFAULT_COPY_C(__class_name__)   __class_name__(const __class_name__& a) = default
 
#define DEFAULT_COPY_A(__class_name__)   __class_name__& operator=(const __class_name__& a) = default
 
#define DEFAULT_MOVE_C(__class_name__)   __class_name__(__class_name__&& a) = default
 
#define DEFAULT_MOVE_A(__class_name__)   __class_name__& operator=(__class_name__&& a) = default
 
#define DEFAULT_COPY(__class_name__)   DEFAULT_COPY_C(__class_name__); DEFAULT_COPY_A(__class_name__)
 
#define DEFAULT_MOVE(__class_name__)   DEFAULT_MOVE_C(__class_name__); DEFAULT_MOVE_A(__class_name__)
 
#define DEFAULT_MEMBERS_X(__class_name__)   DEFAULT_COPY(__class_name__); DEFAULT_MOVE(__class_name__)
 
#define DEFAULT_MEMBERS(__class_name__)   DEFAULT_C(__class_name__); DEFAULT_MEMBERS_X(__class_name__)
 
#define SP_DEFAULT_C(__spec__, __class_name__)   __spec__ __class_name__() = default
 
#define SP_DEFAULT_COPY_C(__spec__, __class_name__)   __spec__ __class_name__(const __class_name__& a) = default
 
#define SP_DEFAULT_COPY_A(__spec__, __class_name__)   __spec__ __class_name__& operator=(const __class_name__& a) = default
 
#define SP_DEFAULT_MOVE_C(__spec__, __class_name__)   __spec__ __class_name__(__class_name__&& a) = default
 
#define SP_DEFAULT_MOVE_A(__spec__, __class_name__)   __spec__ __class_name__& operator=(__class_name__&& a) = default
 
#define SP_DEFAULT_COPY(__spec__, __class_name__)   SP_DEFAULT_COPY_C(__spec__,__class_name__); SP_DEFAULT_COPY_A(__spec__,__class_name__)
 
#define SP_DEFAULT_MOVE(__spec__, __class_name__)   SP_DEFAULT_MOVE_C(__spec__,__class_name__); SP_DEFAULT_MOVE_A(__spec__,__class_name__)
 
#define SP_DEFAULT_MEMBERS_X(__spec__, __class_name__)   SP_DEFAULT_COPY(__spec__,__class_name__); SP_DEFAULT_MOVE(__spec__,__class_name__)
 
#define SP_DEFAULT_MEMBERS(__spec__, __class_name__)   SP_DEFAULT_C(__spec__,__class_name__); SP_DEFAULT_MEMBERS_X(__spec__,__class_name__)
 
#define INDEX_RANDOM_ACCESS_ITERATOR_DEFS(__meta_type__)
 
#define CXZ_CVAL_FALSE   static constexpr bool value = false
 
#define CXZ_CVAL_TRUE   static constexpr bool value = true
 
#define IS_SAME(a, b)   std::is_same<a,b>::value
 
#define IS_NOT_SAME(a, b)   (not std::is_same<a,b>::value)
 
#define SERIALIZATION_FUNCTIONS   static const int v = 0
 
#define SERIALIZATION_FUNCTIONS_NOPUB   static const int v = 0
 

Detailed Description

useful macros

Define useful macros that are used throughout this library for convenience, briefnes and/or debugging.

Copyright (c) 2022 Christian Zimmermann. All rights reserved. Mail: chize.nosp@m.ta@f.nosp@m.3l.de

Definition in file macros.h.

Macro Definition Documentation

◆ CHECK

#define CHECK   std::cout << __FILE__ << ": @" << __LINE__ << " in " << __func__ << std::endl;

Definition at line 21 of file macros.h.

◆ CXZ_CVAL_FALSE

#define CXZ_CVAL_FALSE   static constexpr bool value = false

Definition at line 118 of file macros.h.

◆ CXZ_CVAL_TRUE

#define CXZ_CVAL_TRUE   static constexpr bool value = true

Definition at line 119 of file macros.h.

◆ DEFAULT_C

#define DEFAULT_C ( __class_name__)    __class_name__() = default

shortcut for defining default constructor

Definition at line 29 of file macros.h.

◆ DEFAULT_COPY

#define DEFAULT_COPY ( __class_name__)    DEFAULT_COPY_C(__class_name__); DEFAULT_COPY_A(__class_name__)

shortcut for defining default copy constructor and assignment

Definition at line 44 of file macros.h.

◆ DEFAULT_COPY_A

#define DEFAULT_COPY_A ( __class_name__)    __class_name__& operator=(const __class_name__& a) = default

shortcut for defining default copy assignment

Definition at line 35 of file macros.h.

◆ DEFAULT_COPY_C

#define DEFAULT_COPY_C ( __class_name__)    __class_name__(const __class_name__& a) = default

shortcut for defining default copy constructor

Definition at line 32 of file macros.h.

◆ DEFAULT_MEMBERS

#define DEFAULT_MEMBERS ( __class_name__)    DEFAULT_C(__class_name__); DEFAULT_MEMBERS_X(__class_name__)

shortcut for defining default constructor, default copy and move constructor and assignment

Definition at line 53 of file macros.h.

◆ DEFAULT_MEMBERS_X

#define DEFAULT_MEMBERS_X ( __class_name__)    DEFAULT_COPY(__class_name__); DEFAULT_MOVE(__class_name__)

shortcut for defining default copy and move constructor and assignment

Definition at line 50 of file macros.h.

◆ DEFAULT_MOVE

#define DEFAULT_MOVE ( __class_name__)    DEFAULT_MOVE_C(__class_name__); DEFAULT_MOVE_A(__class_name__)

shortcut for defining default move constructor and assignment

Definition at line 47 of file macros.h.

◆ DEFAULT_MOVE_A

#define DEFAULT_MOVE_A ( __class_name__)    __class_name__& operator=(__class_name__&& a) = default

shortcut for defining default move assignment

Definition at line 41 of file macros.h.

◆ DEFAULT_MOVE_C

#define DEFAULT_MOVE_C ( __class_name__)    __class_name__(__class_name__&& a) = default

shortcut for defining default move constructor

Definition at line 38 of file macros.h.

◆ INDEX_RANDOM_ACCESS_ITERATOR_DEFS

#define INDEX_RANDOM_ACCESS_ITERATOR_DEFS ( __meta_type__)
Value:
typedef std::random_access_iterator_tag iterator_category; \
typedef SizeT difference_type; \
typedef __meta_type__ value_type; \
typedef const __meta_type__* pointer; \
typedef const __meta_type__& reference

shortcut for all typedefs needed to use a class as iterator

Parameters
__meta_type__meta data type

Definition at line 112 of file macros.h.

◆ IS_NOT_SAME

#define IS_NOT_SAME ( a,
b )   (not std::is_same<a,b>::value)

Definition at line 122 of file macros.h.

◆ IS_SAME

#define IS_SAME ( a,
b )   std::is_same<a,b>::value

Definition at line 121 of file macros.h.

◆ SERIALIZATION_FUNCTIONS

#define SERIALIZATION_FUNCTIONS   static const int v = 0

Definition at line 131 of file macros.h.

◆ SERIALIZATION_FUNCTIONS_NOPUB

#define SERIALIZATION_FUNCTIONS_NOPUB   static const int v = 0

Definition at line 132 of file macros.h.

◆ SP_DEFAULT_C

#define SP_DEFAULT_C ( __spec__,
__class_name__ )   __spec__ __class_name__() = default

shortcut for defining default constructor

Parameters
__spec__specifier
__class_name__class name

Definition at line 59 of file macros.h.

◆ SP_DEFAULT_COPY

#define SP_DEFAULT_COPY ( __spec__,
__class_name__ )   SP_DEFAULT_COPY_C(__spec__,__class_name__); SP_DEFAULT_COPY_A(__spec__,__class_name__)

shortcut for defining default copy constructor and assignment

Parameters
__spec__specifier
__class_name__class name

Definition at line 89 of file macros.h.

◆ SP_DEFAULT_COPY_A

#define SP_DEFAULT_COPY_A ( __spec__,
__class_name__ )   __spec__ __class_name__& operator=(const __class_name__& a) = default

shortcut for defining default copy assignment

Parameters
__spec__specifier
__class_name__class name

Definition at line 71 of file macros.h.

◆ SP_DEFAULT_COPY_C

#define SP_DEFAULT_COPY_C ( __spec__,
__class_name__ )   __spec__ __class_name__(const __class_name__& a) = default

shortcut for defining default copy constructor

Parameters
__spec__specifier
__class_name__class name

Definition at line 65 of file macros.h.

◆ SP_DEFAULT_MEMBERS

#define SP_DEFAULT_MEMBERS ( __spec__,
__class_name__ )   SP_DEFAULT_C(__spec__,__class_name__); SP_DEFAULT_MEMBERS_X(__spec__,__class_name__)

shortcut for defining default constructor, default copy and move constructor and assignment

Parameters
__spec__specifier
__class_name__class name

Definition at line 107 of file macros.h.

◆ SP_DEFAULT_MEMBERS_X

#define SP_DEFAULT_MEMBERS_X ( __spec__,
__class_name__ )   SP_DEFAULT_COPY(__spec__,__class_name__); SP_DEFAULT_MOVE(__spec__,__class_name__)

shortcut for defining default copy and move constructor and assignment

Parameters
__spec__specifier
__class_name__class name

Definition at line 101 of file macros.h.

◆ SP_DEFAULT_MOVE

#define SP_DEFAULT_MOVE ( __spec__,
__class_name__ )   SP_DEFAULT_MOVE_C(__spec__,__class_name__); SP_DEFAULT_MOVE_A(__spec__,__class_name__)

shortcut for defining default move constructor and assignment

Parameters
__spec__specifier
__class_name__class name

Definition at line 95 of file macros.h.

◆ SP_DEFAULT_MOVE_A

#define SP_DEFAULT_MOVE_A ( __spec__,
__class_name__ )   __spec__ __class_name__& operator=(__class_name__&& a) = default

shortcut for defining default move assignment

Parameters
__spec__specifier
__class_name__class name

Definition at line 83 of file macros.h.

◆ SP_DEFAULT_MOVE_C

#define SP_DEFAULT_MOVE_C ( __spec__,
__class_name__ )   __spec__ __class_name__(__class_name__&& a) = default

shortcut for defining default move constructor

Parameters
__spec__specifier
__class_name__class name

Definition at line 77 of file macros.h.

◆ VCHECK

#define VCHECK ( a)
Value:
std::cout << __FILE__ << ": @" << __LINE__ \
<< " in " << __func__ << ": " << #a << " = " << a << std::endl;

Definition at line 24 of file macros.h.