#include <zypp-core/base/Easy.h>
#include <cstdio>
#include <type_traits>
Go to the source code of this file.
|
namespace | zypp |
| Easy-to use interface to the ZYPP dependency resolver.
|
|
|
#define | for_(IT, BEG, END) for ( __typeof__(BEG) IT = BEG, _for_end = END; IT != _for_end; ++IT ) |
| Convenient for-loops using iterator.
|
|
#define | for_each_(IT, CONT) for_( IT, (CONT).begin(), (CONT).end() ) |
|
#define | arrayBegin(A) (&A[0]) |
| Simple C-array iterator.
|
|
#define | arraySize(A) (sizeof(A)/sizeof(*A)) |
|
#define | arrayEnd(A) (&A[0] + arraySize(A)) |
|
#define | defConstStr(FNC, STR) inline const std::string & FNC { static const std::string val( STR ); return val; } |
|
#define | GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) |
|
#define | nullptr NULL |
|
#define | NON_COPYABLE(CLASS) |
| Delete copy ctor and copy assign.
|
|
#define | DEFAULT_COPYABLE(CLASS) |
| Default copy ctor and copy assign.
|
|
#define | NON_MOVABLE(CLASS) |
| Delete move ctor and move assign.
|
|
#define | DEFAULT_MOVABLE(CLASS) |
| Default move ctor and move assign.
|
|
#define | NON_COPYABLE_BUT_MOVE(CLASS) |
| Delete copy ctor and copy assign but enable default move.
|
|
#define | NON_MOVABLE_BUT_COPY(CLASS) |
| Default move ctor and move assign but enable default copy.
|
|
|
template<typename TBase , typename TDerived > |
using | disable_use_as_copy_ctor = typename std::enable_if<!std::is_base_of< TBase, typename std::remove_reference< TDerived >::type >::value >::type |
| Prevent an universal ctor to be chosen as copy ctor.
|
|
◆ for_
#define for_ |
( |
|
IT, |
|
|
|
BEG, |
|
|
|
END |
|
) |
| for ( __typeof__(BEG) IT = BEG, _for_end = END; IT != _for_end; ++IT ) |
Convenient for-loops using iterator.
std::set<std::string>; _store;
for_( it, _store.begin(), _store.end() )
{
cout << *it << endl;
}
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
Definition at line 28 of file Easy.h.
◆ for_each_
#define for_each_ |
( |
|
IT, |
|
|
|
CONT |
|
) |
| for_( IT, (CONT).begin(), (CONT).end() ) |
◆ arrayBegin
#define arrayBegin |
( |
|
A | ) |
(&A[0]) |
Simple C-array iterator.
const char * defstrings[] = { "", "a", "default", "two words" };
cout << *it << endl;
#define arrayBegin(A)
Simple C-array iterator.
Definition at line 41 of file Easy.h.
◆ arraySize
#define arraySize |
( |
|
A | ) |
(sizeof(A)/sizeof(*A)) |
◆ arrayEnd
◆ defConstStr
#define defConstStr |
( |
|
FNC, |
|
|
|
STR |
|
) |
| inline const std::string & FNC { static const std::string val( STR ); return val; } |
String related utilities and Regular expression matching.
#define defConstStr(FNC, STR)
Definition at line 51 of file Easy.h.
◆ GCC_VERSION
#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) |
◆ nullptr
◆ NON_COPYABLE
#define NON_COPYABLE |
( |
|
CLASS | ) |
|
Value: CLASS( const CLASS & ) = delete; \
CLASS & operator=( const CLASS & ) = delete
Delete copy ctor and copy assign.
Definition at line 59 of file Easy.h.
◆ DEFAULT_COPYABLE
#define DEFAULT_COPYABLE |
( |
|
CLASS | ) |
|
Value: CLASS( const CLASS & ) = default; \
CLASS & operator=( const CLASS & ) = default
Default copy ctor and copy assign.
Definition at line 64 of file Easy.h.
◆ NON_MOVABLE
#define NON_MOVABLE |
( |
|
CLASS | ) |
|
Value: CLASS( CLASS && ) = delete; \
CLASS & operator=( CLASS && ) = delete
Delete move ctor and move assign.
Definition at line 69 of file Easy.h.
◆ DEFAULT_MOVABLE
#define DEFAULT_MOVABLE |
( |
|
CLASS | ) |
|
Value: CLASS( CLASS && ) = default; \
CLASS & operator=( CLASS && ) = default
Default move ctor and move assign.
Definition at line 74 of file Easy.h.
◆ NON_COPYABLE_BUT_MOVE
#define NON_COPYABLE_BUT_MOVE |
( |
|
CLASS | ) |
|
Value:
DEFAULT_MOVABLE(CLASS)
#define NON_COPYABLE(CLASS)
Delete copy ctor and copy assign.
Delete copy ctor and copy assign but enable default move.
Definition at line 79 of file Easy.h.
◆ NON_MOVABLE_BUT_COPY
#define NON_MOVABLE_BUT_COPY |
( |
|
CLASS | ) |
|
Value:
DEFAULT_COPYABLE(CLASS)
#define NON_MOVABLE(CLASS)
Delete move ctor and move assign.
Default move ctor and move assign but enable default copy.
Definition at line 84 of file Easy.h.
◆ disable_use_as_copy_ctor
template<typename TBase , typename TDerived >
using disable_use_as_copy_ctor = typename std::enable_if<!std::is_base_of<TBase,typename std::remove_reference<TDerived>::type>::value>::type |
Prevent an universal ctor to be chosen as copy ctor.
struct FeedStrings
{
template<typename TARG, typename X = disable_use_as_copy_ctor<FeedStrings,TARG>>
FeedStrings( TARG && arg_r )
{}
template<typename ... Us>
FeedStrings( Us &&... us )
: ...
private:
Definition at line 108 of file Easy.h.