cppcore
A small, portable C++ core library
Loading...
Searching...
No Matches
CPPCoreCommon.h File Reference
#include <cstddef>
#include <cassert>
#include <cinttypes>
#include <string.h>
#include <stddef.h>
#include <stdio.h>
#include <stdarg.h>
#include <malloc.h>
Include dependency graph for CPPCoreCommon.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  cppcore

Macros

#define DLL_CPPCORE_EXPORT   __attribute__((visibility("default")))
#define CPPCORE_STACK_ALLOC(size)
#define CPPCORE_NONE_COPYING(name)
 This macro marks a class a not copyable.
#define CPPCORE_ARRAY_SIZE(x)
 This macro calculates the number of items inside of an array.

Typedefs

using cppcore::HashId = uint64_t

Functions

template<class T>
void cppcore::ContainerClear (T &ctr, void(*DeleterFunc)(T &)=nullptr)

Macro Definition Documentation

◆ CPPCORE_ARRAY_SIZE

#define CPPCORE_ARRAY_SIZE ( x)
Value:
(sizeof(x) / sizeof((x)[0]))

This macro calculates the number of items inside of an array.

Parameters
x[in] The array to get the number of items.
Remarks
Be careful, use it as following:
int array[] = {1,2,3,4}; CPPCORE_ARRAY_SIZE( array ); // correct
void foo( int array[] ) { CPPCORE_ARRAY_SIZE( array ); // not correct
#define CPPCORE_ARRAY_SIZE(x)
This macro calculates the number of items inside of an array.

Definition at line 108 of file CPPCoreCommon.h.

◆ CPPCORE_NONE_COPYING

#define CPPCORE_NONE_COPYING ( name)
Value:
public: \
name( const name & ) = delete ;\
name( name && ) = delete; \
name &operator = ( const name & ) = delete;

This macro marks a class a not copyable.

Parameters
name[in] The name of the class.

Definition at line 91 of file CPPCoreCommon.h.

◆ CPPCORE_STACK_ALLOC

#define CPPCORE_STACK_ALLOC ( size)
Value:
__builtin_alloca(size)

Definition at line 60 of file CPPCoreCommon.h.

Referenced by cppcore::quicksort().

◆ DLL_CPPCORE_EXPORT

#define DLL_CPPCORE_EXPORT   __attribute__((visibility("default")))

Definition at line 59 of file CPPCoreCommon.h.