PIP 5.5.3
Platform-Independent Primitives
Macros | Enumerations | Functions
picontainers.h File Reference

Base macros for generic containers. More...

#include "picout.h"
#include "piintrospection_containers.h"
#include <stdlib.h>
#include <algorithm>
#include <functional>
#include <initializer_list>
#include <new>
#include <string.h>
#include <type_traits>

Macros

#define piForTimes(c)   for (int _i##c = 0; _i##c < c; ++_i##c)
 Macro for short replacement of standart "for". More...
 
#define piForeach(i, c)   for (i: c)
 Macro for iterate any container. More...
 
#define piForeachC(i, c)   for (const i: c)
 Macro for iterate any container. More...
 
#define piForeachR(i, c)   for (i: PIReverseWrap(c))
 Macro for iterate any container. More...
 
#define piForeachRC(i, c)   for (const i: PIReverseWrap(c))
 Macro for iterate any container. More...
 

Enumerations

enum  ReshapeOrder { ReshapeByRow , ReshapeByColumn }
 Reshape order enum for reshape() function. More...
 

Functions

template<typename C >
_PIReverseWrapper< C > PIReverseWrap (C &c)
 Template reverse wrapper over any container.
 

Detailed Description

Base macros for generic containers.

Authors

Ivan Pelipenko peri4.nosp@m.ko@y.nosp@m.andex.nosp@m..ru; Andrey Bychkov work..nosp@m.a.b@.nosp@m.yande.nosp@m.x.ru;

Macro Definition Documentation

◆ piForTimes

#define piForTimes (   c)    for (int _i##c = 0; _i##c < c; ++_i##c)

Macro for short replacement of standart "for".

Parameters
cIteration times in loop

◆ piForeach

#define piForeach (   i,
 
)    for (i: c)

Macro for iterate any container.

Deprecated:
Deprecated, using only for backward compatibility. Use C++ Range-based for loop.

Get read/write access to each element of container. Iterating in forward direction. Example of using:

vec << 1 << 2 << 3;
piForeach(int & i, vec) piCout << i;
// 1
// 2
// 3
piForeach(int & i, vec) i++;
piForeach(int & i, vec) piCout << i;
// 2
// 3
// 4
#define piForeach(i, c)
Macro for iterate any container.
Definition: picontainers.h:166
#define piCout
Macro used for conditional (piDebug) output to PICout(StdOut)
Definition: picout.h:35
See also
piForeachC, piForeachR, piForeachRC

◆ piForeachC

#define piForeachC (   i,
 
)    for (const i: c)

Macro for iterate any container.

Deprecated:
Deprecated, using only for backward compatibility. Use C++ Range-based for loop.

Get read only access to each element of container. Iterating in forward direction.

See also
piForeach, piForeachR, piForeachRC

◆ piForeachR

#define piForeachR (   i,
 
)    for (i: PIReverseWrap(c))

Macro for iterate any container.

Deprecated:
Deprecated, using only for backward compatibility. Use C++ Range-based for loop.

Get read/write access to each element of container. Iterating in backward direction.

See also
piForeach, piForeachC, piForeachRC

◆ piForeachRC

#define piForeachRC (   i,
 
)    for (const i: PIReverseWrap(c))

Macro for iterate any container.

Deprecated:
Deprecated, using only for backward compatibility. Use C++ Range-based for loop.

Get read only access to each element of container. Iterating in backward direction. Also has alias piForeachCR

See also
piForeach, piForeachC, piForeachR

Enumeration Type Documentation

◆ ReshapeOrder

Reshape order enum for reshape() function.

See also
PIVector::reshape(), PIDeque::reshape()
Enumerator
ReshapeByRow 

Traversing elements by line, just as they stay in memory

ReshapeByColumn 

Traversing elements by column