Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/development'
Browse files Browse the repository at this point in the history
# Conflicts:
#	support/Release notes.txt
  • Loading branch information
jwellbelove committed Mar 25, 2018
2 parents 54981cf + 6f6c80f commit 3d52e68
Show file tree
Hide file tree
Showing 39 changed files with 654 additions and 222 deletions.
36 changes: 18 additions & 18 deletions include/etl/basic_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -1466,9 +1466,9 @@ namespace etl
int compare(const ibasic_string& str) const
{
return compare(p_buffer,
p_buffer + size(),
str.p_buffer,
str.p_buffer + str.size());
p_buffer + size(),
str.p_buffer,
str.p_buffer + str.size());
}

//*************************************************************************
Expand All @@ -1482,9 +1482,9 @@ namespace etl
length_ = std::min(length_, size() - position);

return compare(p_buffer + position,
p_buffer + position + length_,
str.p_buffer,
str.p_buffer + str.size());
p_buffer + position + length_,
str.p_buffer,
str.p_buffer + str.size());
}

//*************************************************************************
Expand All @@ -1500,9 +1500,9 @@ namespace etl
sublength = std::min(sublength, str.size() - subposition);

return compare(p_buffer + position,
p_buffer + position + length_,
str.p_buffer + subposition,
str.p_buffer + subposition + sublength);
p_buffer + position + length_,
str.p_buffer + subposition,
str.p_buffer + subposition + sublength);
}

//*************************************************************************
Expand All @@ -1511,9 +1511,9 @@ namespace etl
int compare(const value_type* s) const
{
return compare(p_buffer,
p_buffer + size(),
s,
s + etl::strlen(s));
p_buffer + size(),
s,
s + etl::strlen(s));
}

//*************************************************************************
Expand All @@ -1522,9 +1522,9 @@ namespace etl
int compare(size_t position, size_t length_, const_pointer s) const
{
return compare(p_buffer + position,
p_buffer + position + length_,
s,
s + etl::strlen(s));
p_buffer + position + length_,
s,
s + etl::strlen(s));
}

//*************************************************************************
Expand All @@ -1533,9 +1533,9 @@ namespace etl
int compare(size_t position, size_t length_, const_pointer s, size_t n) const
{
return compare(p_buffer + position,
p_buffer + position + length_,
s,
s + n);;
p_buffer + position + length_,
s,
s + n);
}

//*********************************************************************
Expand Down
33 changes: 24 additions & 9 deletions include/etl/cstring.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ SOFTWARE.
#include "basic_string.h"
#include "hash.h"

#if ETL_CPP11_SUPPORTED
#include <initializer_list>
#endif

#if defined(ETL_COMPILER_MICROSOFT)
#undef min
#endif
Expand Down Expand Up @@ -63,7 +67,7 @@ namespace etl
string()
: istring(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
{
istring::initialise();
this->initialise();
}

//*************************************************************************
Expand All @@ -73,7 +77,7 @@ namespace etl
string(const etl::string<MAX_SIZE_>& other)
: istring(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
{
istring::assign(other.begin(), other.end());
this->assign(other.begin(), other.end());
}

//*************************************************************************
Expand All @@ -90,7 +94,7 @@ namespace etl
// Set the length to the exact amount.
length_ = (length_ > MAX_SIZE_) ? MAX_SIZE_ : length_;

istring::assign(other.begin() + position, other.begin() + position + length_);
this->assign(other.begin() + position, other.begin() + position + length_);
}

//*************************************************************************
Expand All @@ -100,7 +104,7 @@ namespace etl
string(const value_type* text)
: istring(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
{
istring::assign(text, text + etl::char_traits<value_type>::length(text));
this->assign(text, text + etl::char_traits<value_type>::length(text));
}

//*************************************************************************
Expand All @@ -111,7 +115,7 @@ namespace etl
string(const value_type* text, size_t count)
: istring(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
{
istring::assign(text, text + count);
this->assign(text, text + count);
}

//*************************************************************************
Expand All @@ -122,8 +126,8 @@ namespace etl
string(size_t count, value_type c)
: istring(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
{
istring::initialise();
istring::resize(count, c);
this->initialise();
this->resize(count, c);
}

//*************************************************************************
Expand All @@ -136,9 +140,20 @@ namespace etl
string(TIterator first, TIterator last)
: istring(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
{
istring::assign(first, last);
this->assign(first, last);
}

#if ETL_CPP11_SUPPORTED
//*************************************************************************
/// Construct from initializer_list.
//*************************************************************************
string(std::initializer_list<value_type> init)
: istring(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
{
this->assign(init.begin(), init.end());
}
#endif

//*************************************************************************
/// Returns a sub-string.
///\param position The position of the first character. Default = 0.
Expand Down Expand Up @@ -167,7 +182,7 @@ namespace etl
{
if (&rhs != this)
{
istring::assign(rhs.cbegin(), rhs.cend());
this->assign(rhs.cbegin(), rhs.cend());
}

return *this;
Expand Down
29 changes: 22 additions & 7 deletions include/etl/deque.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,12 @@ SOFTWARE.
#include "type_traits.h"
#include "parameter_type.h"

#if ETL_CPP11_SUPPORTED
#include <initializer_list>
#endif

#ifdef ETL_COMPILER_MICROSOFT
#undef min
#undef min
#endif

#undef ETL_FILE
Expand Down Expand Up @@ -2022,15 +2026,15 @@ namespace etl
deque()
: etl::ideque<T>(reinterpret_cast<T*>(&buffer[0]), MAX_SIZE, BUFFER_SIZE)
{
etl::ideque<T>::initialise();
this->initialise();
}

//*************************************************************************
/// Destructor.
//*************************************************************************
~deque()
{
etl::ideque<T>::initialise();
this->initialise();
}

//*************************************************************************
Expand All @@ -2041,7 +2045,7 @@ namespace etl
{
if (this != &other)
{
etl::ideque<T>::assign(other.begin(), other.end());
this->assign(other.begin(), other.end());
}
}

Expand All @@ -2052,7 +2056,7 @@ namespace etl
deque(TIterator begin_, TIterator end_)
: etl::ideque<T>(reinterpret_cast<T*>(&buffer[0]), MAX_SIZE, BUFFER_SIZE)
{
etl::ideque<T>::assign(begin_, end_);
this->assign(begin_, end_);
}

//*************************************************************************
Expand All @@ -2061,8 +2065,19 @@ namespace etl
explicit deque(size_t n, typename etl::ideque<T>::parameter_t value = value_type())
: etl::ideque<T>(reinterpret_cast<T*>(&buffer[0]), MAX_SIZE, BUFFER_SIZE)
{
etl::ideque<T>::assign(n, value);
this->assign(n, value);
}

#if ETL_CPP11_SUPPORTED
//*************************************************************************
/// Construct from initializer_list.
//*************************************************************************
deque(std::initializer_list<T> init)
: ideque<T>(reinterpret_cast<T*>(&buffer[0]), MAX_SIZE, BUFFER_SIZE)
{
this->assign(init.begin(), init.end());
}
#endif

//*************************************************************************
/// Assignment operator.
Expand All @@ -2071,7 +2086,7 @@ namespace etl
{
if (&rhs != this)
{
etl::ideque<T>::assign(rhs.begin(), rhs.end());
this->assign(rhs.begin(), rhs.end());
}

return *this;
Expand Down
23 changes: 19 additions & 4 deletions include/etl/flat_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ SOFTWARE.
#include "reference_flat_map.h"
#include "pool.h"

#if ETL_CPP11_SUPPORTED
#include <initializer_list>
#endif

#undef ETL_FILE
#define ETL_FILE "2"

Expand Down Expand Up @@ -834,7 +838,7 @@ namespace etl
flat_map(const flat_map& other)
: etl::iflat_map<TKey, TValue, TCompare>(lookup, storage)
{
etl::iflat_map<TKey, TValue, TCompare>::assign(other.cbegin(), other.cend());
this->assign(other.cbegin(), other.cend());
}

//*************************************************************************
Expand All @@ -847,15 +851,26 @@ namespace etl
flat_map(TIterator first, TIterator last)
: etl::iflat_map<TKey, TValue, TCompare>(lookup, storage)
{
etl::iflat_map<TKey, TValue, TCompare>::assign(first, last);
this->assign(first, last);
}

#if ETL_CPP11_SUPPORTED
//*************************************************************************
/// Construct from initializer_list.
//*************************************************************************
flat_map(std::initializer_list<typename etl::iflat_map<TKey, TValue, TCompare>::value_type> init)
: etl::iflat_map<TKey, TValue, TCompare>(lookup, storage)
{
this->assign(init.begin(), init.end());
}
#endif

//*************************************************************************
/// Destructor.
//*************************************************************************
~flat_map()
{
etl::iflat_map<TKey, TValue, TCompare>::clear();
this->clear();
}

//*************************************************************************
Expand All @@ -865,7 +880,7 @@ namespace etl
{
if (&rhs != this)
{
etl::iflat_map<TKey, TValue, TCompare>::assign(rhs.cbegin(), rhs.cend());
this->assign(rhs.cbegin(), rhs.cend());
}

return *this;
Expand Down
23 changes: 19 additions & 4 deletions include/etl/flat_multimap.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ SOFTWARE.
#include "reference_flat_multimap.h"
#include "pool.h"

#if ETL_CPP11_SUPPORTED
#include <initializer_list>
#endif

#undef ETL_FILE
#define ETL_FILE "3"

Expand Down Expand Up @@ -715,7 +719,7 @@ namespace etl
flat_multimap(const flat_multimap& other)
: etl::iflat_multimap<TKey, TValue, TCompare>(lookup, storage)
{
etl::iflat_multimap<TKey, TValue, TCompare>::assign(other.cbegin(), other.cend());
this->assign(other.cbegin(), other.cend());
}

//*************************************************************************
Expand All @@ -728,15 +732,26 @@ namespace etl
flat_multimap(TIterator first, TIterator last)
: etl::iflat_multimap<TKey, TValue, TCompare>(lookup, storage)
{
etl::iflat_multimap<TKey, TValue, TCompare>::assign(first, last);
this->assign(first, last);
}

#if ETL_CPP11_SUPPORTED
//*************************************************************************
/// Construct from initializer_list.
//*************************************************************************
flat_multimap(std::initializer_list<typename etl::iflat_multimap<TKey, TValue, TCompare>::value_type> init)
: etl::iflat_multimap<TKey, TValue, TCompare>(lookup, storage)
{
this->assign(init.begin(), init.end());
}
#endif

//*************************************************************************
/// Destructor.
//*************************************************************************
~flat_multimap()
{
etl::iflat_multimap<TKey, TValue, TCompare>::clear();
this->clear();
}

//*************************************************************************
Expand All @@ -746,7 +761,7 @@ namespace etl
{
if (&rhs != this)
{
etl::iflat_multimap<TKey, TValue, TCompare>::assign(rhs.cbegin(), rhs.cend());
this->assign(rhs.cbegin(), rhs.cend());
}

return *this;
Expand Down
Loading

0 comments on commit 3d52e68

Please sign in to comment.