mirror of
https://github.com/Ed94/gencpp.git
synced 2025-07-15 18:08:59 -07:00
Reduce cpp freatures usage of Array container.
Almost ready to be inter-operable with C
This commit is contained in:
@ -187,7 +187,7 @@
|
||||
|
||||
#if !defined(typeof) && (!GEN_COMPILER_C || __STDC_VERSION__ < 202311L)
|
||||
# if ! GEN_COMPILER_C
|
||||
# define typeof
|
||||
# define typeof decltype
|
||||
# elif defined(_MSC_VER)
|
||||
# define typeof(x) __typeof(x)
|
||||
# elif defined(__GNUC__) || defined(__clang__)
|
||||
@ -197,4 +197,12 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// This is intended to only really be used internally or with the C-library variant
|
||||
// C++ users can just use the for-range directly.
|
||||
#if GEN_COMPILER_C
|
||||
# define foreach(Type, entry_id, iterable) for ( Type entry_id = begin(iterable); entry_id != end(iterable); entry_id = next(entry_id) )
|
||||
#else
|
||||
# define foreach(Type, entry_id, iterable) for ( Type entry_id : iterable )
|
||||
#endif
|
||||
|
||||
#pragma endregion Macros
|
||||
|
Reference in New Issue
Block a user