• R/O
  • SSH
  • HTTPS

eirrepo: Commit


Commit MetaInfo

Revision162 (tree)
Time2018-12-11 05:13:02
Authorquiret

Log Message

- added C++ range-based for support in connection with eir::Vector

Change Summary

Incremental Difference

--- common/sdk/UniChar.h (revision 161)
+++ common/sdk/UniChar.h (revision 162)
@@ -1149,7 +1149,7 @@
11491149 }
11501150 }
11511151
1152- template <typename inputCharType, typename outputCharType, bool optimizeEqual = true, typename allocatorType, typename... Args>
1152+ template <typename inputCharType, typename outputCharType, typename allocatorType, bool optimizeEqual = true, typename... Args>
11531153 inline eir::String <outputCharType, allocatorType> ConvertStrings( const eir::String <inputCharType, allocatorType>& inputStr, Args... allocArgs )
11541154 {
11551155 if constexpr ( optimizeEqual && std::is_same <inputCharType, outputCharType>::value )
--- common/sdk/Vector.h (revision 161)
+++ common/sdk/Vector.h (revision 162)
@@ -1112,6 +1112,13 @@
11121112 }
11131113 }
11141114
1115+ // To support the C++11 range-based for loop.
1116+ AINLINE structType* begin( void ) { return ( this->data.data_entries ); }
1117+ AINLINE structType* end( void ) { return ( this->data.data_entries + this->data.data_count ); }
1118+
1119+ AINLINE const structType* begin( void ) const { return ( this->data.data_entries ); }
1120+ AINLINE const structType* end( void ) const { return ( this->data.data_entries + this->data.data_count ); }
1121+
11151122 // Indexing operators.
11161123 inline structType& operator [] ( size_t idx )
11171124 {
Show on old repository browser