Merge remote-tracking branch 'origin/development'

# Conflicts:
#	support/Release notes.txt
This commit is contained in:
John Wellbelove 2018-03-25 14:42:29 +01:00
commit 3d52e68090
39 changed files with 654 additions and 222 deletions

View File

@ -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());
}
//*************************************************************************
@ -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());
}
//*************************************************************************
@ -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);
}
//*************************************************************************
@ -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));
}
//*************************************************************************
@ -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));
}
//*************************************************************************
@ -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);
}
//*********************************************************************

View File

@ -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
@ -63,7 +67,7 @@ namespace etl
string()
: istring(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
{
istring::initialise();
this->initialise();
}
//*************************************************************************
@ -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());
}
//*************************************************************************
@ -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_);
}
//*************************************************************************
@ -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));
}
//*************************************************************************
@ -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);
}
//*************************************************************************
@ -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);
}
//*************************************************************************
@ -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.
@ -167,7 +182,7 @@ namespace etl
{
if (&rhs != this)
{
istring::assign(rhs.cbegin(), rhs.cend());
this->assign(rhs.cbegin(), rhs.cend());
}
return *this;

View File

@ -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
@ -2022,7 +2026,7 @@ namespace etl
deque()
: etl::ideque<T>(reinterpret_cast<T*>(&buffer[0]), MAX_SIZE, BUFFER_SIZE)
{
etl::ideque<T>::initialise();
this->initialise();
}
//*************************************************************************
@ -2030,7 +2034,7 @@ namespace etl
//*************************************************************************
~deque()
{
etl::ideque<T>::initialise();
this->initialise();
}
//*************************************************************************
@ -2041,7 +2045,7 @@ namespace etl
{
if (this != &other)
{
etl::ideque<T>::assign(other.begin(), other.end());
this->assign(other.begin(), other.end());
}
}
@ -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_);
}
//*************************************************************************
@ -2061,9 +2065,20 @@ 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.
//*************************************************************************
@ -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;

View File

@ -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"
@ -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());
}
//*************************************************************************
@ -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();
}
//*************************************************************************
@ -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;

View File

@ -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"
@ -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());
}
//*************************************************************************
@ -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();
}
//*************************************************************************
@ -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;

View File

@ -35,6 +35,10 @@ SOFTWARE.
#include "reference_flat_multiset.h"
#include "pool.h"
#if ETL_CPP11_SUPPORTED
#include <initializer_list>
#endif
#undef ETL_FILE
#define ETL_FILE "4"
@ -674,7 +678,7 @@ namespace etl
flat_multiset(const flat_multiset& other)
: iflat_multiset<T, TCompare>(lookup, storage)
{
etl::iflat_multiset<T, TCompare>::assign(other.cbegin(), other.cend());
this->assign(other.cbegin(), other.cend());
}
//*************************************************************************
@ -687,15 +691,26 @@ namespace etl
flat_multiset(TIterator first, TIterator last)
: iflat_multiset<T, TCompare>(lookup, storage)
{
etl::iflat_multiset<T, TCompare>::assign(first, last);
this->assign(first, last);
}
#if ETL_CPP11_SUPPORTED
//*************************************************************************
/// Construct from initializer_list.
//*************************************************************************
flat_multiset(std::initializer_list<T> init)
: iflat_multiset<T, TCompare>(lookup, storage)
{
this->assign(init.begin(), init.end());
}
#endif
//*************************************************************************
/// Destructor.
//*************************************************************************
~flat_multiset()
{
etl::iflat_multiset<T, TCompare>::clear();
this->clear();
}
//*************************************************************************
@ -705,7 +720,7 @@ namespace etl
{
if (&rhs != this)
{
etl::iflat_multiset<T, TCompare>::assign(rhs.cbegin(), rhs.cend());
this->assign(rhs.cbegin(), rhs.cend());
}
return *this;

View File

@ -35,6 +35,10 @@ SOFTWARE.
#include "reference_flat_set.h"
#include "pool.h"
#if ETL_CPP11_SUPPORTED
#include <initializer_list>
#endif
#undef ETL_FILE
#define ETL_FILE "5"
@ -740,7 +744,7 @@ namespace etl
flat_set(const flat_set& other)
: etl::iflat_set<T, TCompare>(lookup, storage)
{
etl::iflat_set<T, TCompare>::assign(other.cbegin(), other.cend());
this->assign(other.cbegin(), other.cend());
}
//*************************************************************************
@ -753,15 +757,26 @@ namespace etl
flat_set(TIterator first, TIterator last)
: etl::iflat_set<T, TCompare>(lookup, storage)
{
etl::iflat_set<T, TCompare>::assign(first, last);
this->assign(first, last);
}
#if ETL_CPP11_SUPPORTED
//*************************************************************************
/// Construct from initializer_list.
//*************************************************************************
flat_set(std::initializer_list<T> init)
: etl::iflat_set<T, TCompare>(lookup, storage)
{
this->assign(init.begin(), init.end());
}
#endif
//*************************************************************************
/// Destructor.
//*************************************************************************
~flat_set()
{
etl::iflat_set<T, TCompare>::clear();
this->clear();
}
//*************************************************************************
@ -771,7 +786,7 @@ namespace etl
{
if (&rhs != this)
{
etl::iflat_set<T, TCompare>::assign(rhs.cbegin(), rhs.cend());
this->assign(rhs.cbegin(), rhs.cend());
}
return *this;

View File

@ -46,6 +46,10 @@ SOFTWARE.
#include "type_traits.h"
#include "parameter_type.h"
#if ETL_CPP11_SUPPORTED
#include <initializer_list>
#endif
#ifdef ETL_COMPILER_MICROSOFT
#undef min
#endif
@ -1382,7 +1386,7 @@ namespace etl
forward_list()
: etl::iforward_list<T>(node_pool, MAX_SIZE)
{
etl::iforward_list<T>::initialise();
this->initialise();
}
//*************************************************************************
@ -1391,7 +1395,7 @@ namespace etl
explicit forward_list(size_t initial_size, typename etl::iforward_list<T>::parameter_t value = T())
: etl::iforward_list<T>(node_pool, MAX_SIZE)
{
etl::iforward_list<T>::assign(initial_size, value);
this->assign(initial_size, value);
}
//*************************************************************************
@ -1400,7 +1404,7 @@ namespace etl
forward_list(const forward_list& other)
: etl::iforward_list<T>(node_pool, MAX_SIZE)
{
etl::iforward_list<T>::assign(other.cbegin(), other.cend());
this->assign(other.cbegin(), other.cend());
}
//*************************************************************************
@ -1410,15 +1414,26 @@ namespace etl
forward_list(TIterator first, TIterator last)
: etl::iforward_list<T>(node_pool, MAX_SIZE)
{
etl::iforward_list<T>::assign(first, last);
this->assign(first, last);
}
#if ETL_CPP11_SUPPORTED
//*************************************************************************
/// Construct from initializer_list.
//*************************************************************************
forward_list(std::initializer_list<T> init)
: etl::iforward_list<T>(node_pool, MAX_SIZE)
{
this->assign(init.begin(), init.end());
}
#endif
//*************************************************************************
/// Destructor.
//*************************************************************************
~forward_list()
{
etl::iforward_list<T>::initialise();
this->initialise();
}
//*************************************************************************
@ -1428,7 +1443,7 @@ namespace etl
{
if (&rhs != this)
{
etl::iforward_list<T>::assign(rhs.cbegin(), rhs.cend());
this->assign(rhs.cbegin(), rhs.cend());
}
return *this;

View File

@ -47,8 +47,12 @@ SOFTWARE.
#include "parameter_type.h"
#include "algorithm.h"
#if ETL_CPP11_SUPPORTED
#include <initializer_list>
#endif
#ifdef ETL_COMPILER_MICROSOFT
#undef min
#undef min
#endif
#undef ETL_FILE
@ -1602,7 +1606,7 @@ namespace etl
list()
: etl::ilist<T>(node_pool, MAX_SIZE)
{
etl::ilist<T>::initialise();
this->initialise();
}
//*************************************************************************
@ -1610,7 +1614,7 @@ namespace etl
//*************************************************************************
~list()
{
etl::ilist<T>::initialise();
this->initialise();
}
//*************************************************************************
@ -1619,7 +1623,7 @@ namespace etl
explicit list(size_t initial_size)
: etl::ilist<T>(node_pool, MAX_SIZE)
{
etl::ilist<T>::assign(initial_size, T());
this->assign(initial_size, T());
}
//*************************************************************************
@ -1628,7 +1632,7 @@ namespace etl
list(size_t initial_size, typename ilist<T>::parameter_t value)
: etl::ilist<T>(node_pool, MAX_SIZE)
{
etl::ilist<T>::assign(initial_size, value);
this->assign(initial_size, value);
}
//*************************************************************************
@ -1639,7 +1643,7 @@ namespace etl
{
if (this != &other)
{
etl::ilist<T>::assign(other.cbegin(), other.cend());
this->assign(other.cbegin(), other.cend());
}
}
@ -1650,9 +1654,20 @@ namespace etl
list(TIterator first, TIterator last)
: ilist<T>(node_pool, MAX_SIZE)
{
etl::ilist<T>::assign(first, last);
this->assign(first, last);
}
#if ETL_CPP11_SUPPORTED
//*************************************************************************
/// Construct from initializer_list.
//*************************************************************************
list(std::initializer_list<T> init)
: ilist<T>(node_pool, MAX_SIZE)
{
this->assign(init.begin(), init.end());
}
#endif
//*************************************************************************
/// Assignment operator.
//*************************************************************************
@ -1660,7 +1675,7 @@ namespace etl
{
if (&rhs != this)
{
etl::ilist<T>::assign(rhs.cbegin(), rhs.cend());
this->assign(rhs.cbegin(), rhs.cend());
}
return *this;

View File

@ -47,8 +47,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
@ -2036,7 +2040,7 @@ namespace etl
map()
: etl::imap<TKey, TValue, TCompare>(node_pool, MAX_SIZE)
{
etl::imap<TKey, TValue, TCompare>::initialise();
this->initialise();
}
//*************************************************************************
@ -2045,7 +2049,7 @@ namespace etl
map(const map& other)
: etl::imap<TKey, TValue, TCompare>(node_pool, MAX_SIZE)
{
etl::imap<TKey, TValue, TCompare>::assign(other.cbegin(), other.cend());
this->assign(other.cbegin(), other.cend());
}
//*************************************************************************
@ -2058,15 +2062,26 @@ namespace etl
map(TIterator first, TIterator last)
: etl::imap<TKey, TValue, TCompare>(node_pool, MAX_SIZE)
{
etl::imap<TKey, TValue, TCompare>::assign(first, last);
this->assign(first, last);
}
#if ETL_CPP11_SUPPORTED
//*************************************************************************
/// Constructor, from an initializer_list.
//*************************************************************************
map(std::initializer_list<typename etl::imap<TKey, TValue, TCompare>::value_type> init)
: etl::imap<TKey, TValue, TCompare>(node_pool, MAX_SIZE)
{
this->assign(init.begin(), init.end());
}
#endif
//*************************************************************************
/// Destructor.
//*************************************************************************
~map()
{
etl::imap<TKey, TValue, TCompare>::initialise();
this->initialise();
}
//*************************************************************************
@ -2077,7 +2092,7 @@ namespace etl
// Skip if doing self assignment
if (this != &rhs)
{
etl::imap<TKey, TValue, TCompare>::assign(rhs.cbegin(), rhs.cend());
this->assign(rhs.cbegin(), rhs.cend());
}
return *this;

View File

@ -46,6 +46,10 @@ SOFTWARE.
#include "type_traits.h"
#include "parameter_type.h"
#if ETL_CPP11_SUPPORTED
#include <initializer_list>
#endif
#ifdef ETL_COMPILER_MICROSOFT
#undef min
#endif
@ -1921,7 +1925,7 @@ namespace etl
multimap()
: etl::imultimap<TKey, TValue, TCompare>(node_pool, MAX_SIZE)
{
etl::imultimap<TKey, TValue, TCompare>::initialise();
this->initialise();
}
//*************************************************************************
@ -1930,7 +1934,7 @@ namespace etl
multimap(const multimap& other)
: etl::imultimap<TKey, TValue, TCompare>(node_pool, MAX_SIZE)
{
etl::imultimap<TKey, TValue, TCompare>::assign(other.cbegin(), other.cend());
this->assign(other.cbegin(), other.cend());
}
//*************************************************************************
@ -1943,15 +1947,26 @@ namespace etl
multimap(TIterator first, TIterator last)
: etl::imultimap<TKey, TValue, TCompare>(node_pool, MAX_SIZE)
{
etl::imultimap<TKey, TValue, TCompare>::assign(first, last);
this->assign(first, last);
}
#if ETL_CPP11_SUPPORTED
//*************************************************************************
/// Constructor, from an initializer_list.
//*************************************************************************
multimap(std::initializer_list<typename etl::imultimap<TKey, TValue, TCompare>::value_type> init)
: etl::imultimap<TKey, TValue, TCompare>(node_pool, MAX_SIZE)
{
this->assign(init.begin(), init.end());
}
#endif
//*************************************************************************
/// Destructor.
//*************************************************************************
~multimap()
{
etl::imultimap<TKey, TValue, TCompare>::initialise();
this->initialise();
}
//*************************************************************************
@ -1962,7 +1977,7 @@ namespace etl
// Skip if doing self assignment
if (this != &rhs)
{
etl::imultimap<TKey, TValue, TCompare>::assign(rhs.cbegin(), rhs.cend());
this->assign(rhs.cbegin(), rhs.cend());
}
return *this;

View File

@ -46,6 +46,10 @@ SOFTWARE.
#include "nullptr.h"
#include "type_traits.h"
#if ETL_CPP11_SUPPORTED
#include <initializer_list>
#endif
#ifdef ETL_COMPILER_MICROSOFT
#undef min
#endif
@ -1901,7 +1905,7 @@ namespace etl
multiset()
: etl::imultiset<T, TCompare>(node_pool, MAX_SIZE)
{
etl::imultiset<T, TCompare>::initialise();
this->initialise();
}
//*************************************************************************
@ -1910,7 +1914,7 @@ namespace etl
multiset(const multiset& other)
: etl::imultiset<T, TCompare>(node_pool, MAX_SIZE)
{
etl::imultiset<T, TCompare>::assign(other.cbegin(), other.cend());
this->assign(other.cbegin(), other.cend());
}
//*************************************************************************
@ -1923,15 +1927,26 @@ namespace etl
multiset(TIterator first, TIterator last)
: etl::imultiset<T, TCompare>(node_pool, MAX_SIZE)
{
etl::imultiset<T, TCompare>::assign(first, last);
this->assign(first, last);
}
#if ETL_CPP11_SUPPORTED
//*************************************************************************
/// Constructor, from an initializer_list.
//*************************************************************************
multiset(std::initializer_list<typename etl::imultiset<T, TCompare>::value_type> init)
: etl::imultiset<T, TCompare>(node_pool, MAX_SIZE)
{
this->assign(init.begin(), init.end());
}
#endif
//*************************************************************************
/// Destructor.
//*************************************************************************
~multiset()
{
etl::imultiset<T, TCompare>::initialise();
this->initialise();
}
//*************************************************************************
@ -1942,7 +1957,7 @@ namespace etl
// Skip if doing self assignment
if (this != &rhs)
{
etl::imultiset<T, TCompare>::assign(rhs.cbegin(), rhs.cend());
this->assign(rhs.cbegin(), rhs.cend());
}
return *this;

View File

@ -46,6 +46,10 @@ SOFTWARE.
#include "type_traits.h"
#include "parameter_type.h"
#if ETL_CPP11_SUPPORTED
#include <initializer_list>
#endif
#ifdef ETL_COMPILER_MICROSOFT
#undef min
#endif
@ -1959,7 +1963,7 @@ namespace etl
set()
: etl::iset<T, TCompare>(node_pool, MAX_SIZE)
{
etl::iset<T, TCompare>::initialise();
this->initialise();
}
//*************************************************************************
@ -1968,7 +1972,7 @@ namespace etl
set(const set& other)
: etl::iset<T, TCompare>(node_pool, MAX_SIZE)
{
etl::iset<T, TCompare>::assign(other.cbegin(), other.cend());
this->assign(other.cbegin(), other.cend());
}
//*************************************************************************
@ -1981,15 +1985,26 @@ namespace etl
set(TIterator first, TIterator last)
: etl::iset<T, TCompare>(node_pool, MAX_SIZE)
{
etl::iset<T, TCompare>::assign(first, last);
this->assign(first, last);
}
#if ETL_CPP11_SUPPORTED
//*************************************************************************
/// Constructor, from an initializer_list.
//*************************************************************************
set(std::initializer_list<typename etl::iset<T, TCompare>::value_type> init)
: etl::iset<T, TCompare>(node_pool, MAX_SIZE)
{
this->assign(init.begin(), init.end());
}
#endif
//*************************************************************************
/// Destructor.
//*************************************************************************
~set()
{
etl::iset<T, TCompare>::initialise();
this->initialise();
}
//*************************************************************************
@ -2000,7 +2015,7 @@ namespace etl
// Skip if doing self assignment
if (this != &rhs)
{
etl::iset<T, TCompare>::assign(rhs.cbegin(), rhs.cend());
this->assign(rhs.cbegin(), rhs.cend());
}
return *this;

View File

@ -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
@ -63,7 +67,7 @@ namespace etl
u16string()
: iu16string(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
{
iu16string::initialise();
this->initialise();
}
//*************************************************************************
@ -73,8 +77,8 @@ namespace etl
u16string(const etl::u16string<MAX_SIZE_>& other)
: iu16string(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
{
iu16string::initialise();
iu16string::assign(other.begin(), other.end());
this->initialise();
this->assign(other.begin(), other.end());
}
//*************************************************************************
@ -91,8 +95,8 @@ namespace etl
// Set the length to the exact amount.
length_ = (length_ > MAX_SIZE_) ? MAX_SIZE_ : length_;
iu16string::initialise();
iu16string::assign(other.begin() + position, other.begin() + position + length_);
this->initialise();
this->assign(other.begin() + position, other.begin() + position + length_);
}
//*************************************************************************
@ -102,8 +106,8 @@ namespace etl
u16string(const value_type* text)
: iu16string(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
{
iu16string::initialise();
iu16string::assign(text, text + etl::char_traits<value_type>::length(text));
this->initialise();
this->assign(text, text + etl::char_traits<value_type>::length(text));
}
//*************************************************************************
@ -114,8 +118,8 @@ namespace etl
u16string(const value_type* text, size_t count)
: iu16string(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
{
iu16string::initialise();
iu16string::assign(text, text + count);
this->initialise();
this->assign(text, text + count);
}
//*************************************************************************
@ -126,8 +130,8 @@ namespace etl
u16string(size_t count, value_type c)
: iu16string(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
{
iu16string::initialise();
iu16string::resize(count, c);
this->initialise();
this->resize(count, c);
}
//*************************************************************************
@ -140,9 +144,20 @@ namespace etl
u16string(TIterator first, TIterator last)
: iu16string(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
{
iu16string::assign(first, last);
this->assign(first, last);
}
#if ETL_CPP11_SUPPORTED
//*************************************************************************
/// Construct from initializer_list.
//*************************************************************************
u16string(std::initializer_list<value_type> init)
: iu16string(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.
@ -171,7 +186,7 @@ namespace etl
{
if (&rhs != this)
{
iu16string::assign(rhs.cbegin(), rhs.cend());
this->assign(rhs.cbegin(), rhs.cend());
}
return *this;

View File

@ -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
@ -63,7 +67,7 @@ namespace etl
u32string()
: iu32string(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
{
iu32string::initialise();
this->initialise();
}
//*************************************************************************
@ -73,8 +77,8 @@ namespace etl
u32string(const etl::u32string<MAX_SIZE_>& other)
: iu32string(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
{
iu32string::initialise();
iu32string::assign(other.begin(), other.end());
this->initialise();
this->assign(other.begin(), other.end());
}
//*************************************************************************
@ -91,8 +95,8 @@ namespace etl
// Set the length to the exact amount.
length_ = (length_ > MAX_SIZE_) ? MAX_SIZE_ : length_;
iu32string::initialise();
iu32string::assign(other.begin() + position, other.begin() + position + length_);
this->initialise();
this->assign(other.begin() + position, other.begin() + position + length_);
}
//*************************************************************************
@ -102,8 +106,8 @@ namespace etl
u32string(const value_type* text)
: iu32string(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
{
iu32string::initialise();
iu32string::assign(text, text + etl::char_traits<value_type>::length(text));
this->initialise();
this->assign(text, text + etl::char_traits<value_type>::length(text));
}
//*************************************************************************
@ -114,8 +118,8 @@ namespace etl
u32string(const value_type* text, size_t count)
: iu32string(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
{
iu32string::initialise();
iu32string::assign(text, text + count);
this->initialise();
this->assign(text, text + count);
}
//*************************************************************************
@ -126,8 +130,8 @@ namespace etl
u32string(size_t count, value_type c)
: iu32string(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
{
iu32string::initialise();
iu32string::resize(count, c);
this->initialise();
this->resize(count, c);
}
//*************************************************************************
@ -140,9 +144,20 @@ namespace etl
u32string(TIterator first, TIterator last)
: iu32string(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
{
iu32string::assign(first, last);
this->assign(first, last);
}
#if ETL_CPP11_SUPPORTED
//*************************************************************************
/// Construct from initializer_list.
//*************************************************************************
u32string(std::initializer_list<value_type> init)
: iu32string(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.
@ -171,7 +186,7 @@ namespace etl
{
if (&rhs != this)
{
iu32string::assign(rhs.cbegin(), rhs.cend());
this->assign(rhs.cbegin(), rhs.cend());
}
return *this;

View File

@ -53,8 +53,12 @@ SOFTWARE.
#include "debug_count.h"
#include "private/vector_base.h"
#if ETL_CPP11_SUPPORTED
#include <initializer_list>
#endif
#ifdef ETL_COMPILER_GCC
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wunused-variable"
#endif
//*****************************************************************************
@ -1071,7 +1075,7 @@ namespace etl
vector()
: etl::ivector<T>(reinterpret_cast<T*>(&buffer), MAX_SIZE)
{
etl::ivector<T>::initialise();
this->initialise();
}
//*************************************************************************
@ -1081,8 +1085,8 @@ namespace etl
explicit vector(size_t initial_size)
: etl::ivector<T>(reinterpret_cast<T*>(&buffer), MAX_SIZE)
{
etl::ivector<T>::initialise();
etl::ivector<T>::resize(initial_size);
this->initialise();
this->resize(initial_size);
}
//*************************************************************************
@ -1093,8 +1097,8 @@ namespace etl
vector(size_t initial_size, typename etl::ivector<T>::parameter_t value)
: etl::ivector<T>(reinterpret_cast<T*>(&buffer), MAX_SIZE)
{
etl::ivector<T>::initialise();
etl::ivector<T>::resize(initial_size, value);
this->initialise();
this->resize(initial_size, value);
}
//*************************************************************************
@ -1107,16 +1111,27 @@ namespace etl
vector(TIterator first, TIterator last)
: etl::ivector<T>(reinterpret_cast<T*>(&buffer), MAX_SIZE)
{
etl::ivector<T>::assign(first, last);
this->assign(first, last);
}
#if ETL_CPP11_SUPPORTED
//*************************************************************************
/// Constructor, from an initializer_list.
//*************************************************************************
vector(std::initializer_list<T> init)
: etl::ivector<T>(reinterpret_cast<T*>(&buffer), MAX_SIZE)
{
this->assign(init.begin(), init.end());
}
#endif
//*************************************************************************
/// Copy constructor.
//*************************************************************************
vector(const vector& other)
: etl::ivector<T>(reinterpret_cast<T*>(&buffer), MAX_SIZE)
{
etl::ivector<T>::assign(other.begin(), other.end());
this->assign(other.begin(), other.end());
}
//*************************************************************************
@ -1124,7 +1139,7 @@ namespace etl
//*************************************************************************
~vector()
{
etl::ivector<T>::clear();
this->clear();
}
//*************************************************************************
@ -1134,7 +1149,7 @@ namespace etl
{
if (&rhs != this)
{
etl::ivector<T>::assign(rhs.cbegin(), rhs.cend());
this->assign(rhs.cbegin(), rhs.cend());
}
return *this;
@ -1176,7 +1191,7 @@ namespace etl
vector()
: etl::ivector<T*>(reinterpret_cast<T**>(&buffer), MAX_SIZE)
{
etl::ivector<T*>::initialise();
this->initialise();
}
//*************************************************************************
@ -1186,8 +1201,8 @@ namespace etl
explicit vector(size_t initial_size)
: etl::ivector<T*>(reinterpret_cast<T**>(&buffer), MAX_SIZE)
{
etl::ivector<T*>::initialise();
etl::ivector<T*>::resize(initial_size);
this->initialise();
this->resize(initial_size);
}
//*************************************************************************
@ -1198,8 +1213,8 @@ namespace etl
vector(size_t initial_size, typename etl::ivector<T*>::parameter_t value)
: etl::ivector<T*>(reinterpret_cast<T**>(&buffer), MAX_SIZE)
{
etl::ivector<T*>::initialise();
etl::ivector<T*>::resize(initial_size, value);
this->initialise();
this->resize(initial_size, value);
}
//*************************************************************************
@ -1212,16 +1227,27 @@ namespace etl
vector(TIterator first, TIterator last)
: etl::ivector<T*>(reinterpret_cast<T**>(&buffer), MAX_SIZE)
{
etl::ivector<T*>::assign(first, last);
this->assign(first, last);
}
#if ETL_CPP11_SUPPORTED
//*************************************************************************
/// Constructor, from an initializer_list.
//*************************************************************************
vector(std::initializer_list<T*> init)
: etl::ivector<T*>(reinterpret_cast<T**>(&buffer), MAX_SIZE)
{
this->assign(init.begin(), init.end());
}
#endif
//*************************************************************************
/// Copy constructor.
//*************************************************************************
vector(const vector& other)
: etl::ivector<T*>(reinterpret_cast<T**>(&buffer), MAX_SIZE)
{
etl::ivector<T*>::assign(other.begin(), other.end());
this->assign(other.begin(), other.end());
}
//*************************************************************************
@ -1231,7 +1257,7 @@ namespace etl
{
if (&rhs != this)
{
etl::ivector<T*>::assign(rhs.cbegin(), rhs.cend());
this->assign(rhs.cbegin(), rhs.cend());
}
return *this;

View File

@ -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
@ -63,7 +67,7 @@ namespace etl
wstring()
: iwstring(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
{
iwstring::initialise();
this->initialise();
}
//*************************************************************************
@ -92,8 +96,8 @@ namespace etl
// Set the length to the exact amount.
length_ = (length_ > MAX_SIZE_) ? MAX_SIZE_ : length_;
iwstring::initialise();
iwstring::assign(other.begin() + position, other.begin() + position + length_);
this->initialise();
this->assign(other.begin() + position, other.begin() + position + length_);
}
//*************************************************************************
@ -103,8 +107,8 @@ namespace etl
wstring(const value_type* text)
: iwstring(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
{
iwstring::initialise();
iwstring::assign(text, text + etl::char_traits<value_type>::length(text));
this->initialise();
this->assign(text, text + etl::char_traits<value_type>::length(text));
}
//*************************************************************************
@ -115,8 +119,8 @@ namespace etl
wstring(const value_type* text, size_t count)
: iwstring(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
{
iwstring::initialise();
iwstring::assign(text, text + count);
this->initialise();
this->assign(text, text + count);
}
//*************************************************************************
@ -127,8 +131,8 @@ namespace etl
wstring(size_t count, value_type c)
: iwstring(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
{
iwstring::initialise();
iwstring::resize(count, c);
this->initialise();
this->resize(count, c);
}
//*************************************************************************
@ -141,9 +145,20 @@ namespace etl
wstring(TIterator first, TIterator last)
: iwstring(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
{
iwstring::assign(first, last);
this->assign(first, last);
}
#if ETL_CPP11_SUPPORTED
//*************************************************************************
/// Construct from initializer_list.
//*************************************************************************
wstring(std::initializer_list<value_type> init)
: iwstring(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.
@ -172,7 +187,7 @@ namespace etl
{
if (&rhs != this)
{
iwstring::assign(rhs.cbegin(), rhs.cend());
this->assign(rhs.cbegin(), rhs.cend());
}
return *this;

View File

@ -1,9 +1,13 @@
===============================================================================
11.00.1
11.1.0
Added std::initializer_list constructors to containers, if ETL_CPP11_SUPPORTED is set to 1
===============================================================================
11.0.1
Added reset() to etl::optional
===============================================================================
11.00.0
11.0.0
New directory structure.
C & CPP files in src/
H files in include/etl/

View File

@ -136,6 +136,16 @@ namespace
CHECK(std::equal(compare_data.begin(), compare_data.end(), data.begin()));
}
//*************************************************************************
TEST(test_constructor_initializer_list)
{
Compare_Data compare_data = { N0, N1, N2, N3 };
DataNDC data = { N0, N1, N2, N3 };
CHECK_EQUAL(compare_data.size(), data.size());
CHECK(std::equal(compare_data.begin(), compare_data.end(), data.begin()));
}
//*************************************************************************
TEST(test_copy_constructor)
{

View File

@ -189,22 +189,6 @@ namespace
return true;
}
//*************************************************************************
// std::ostream& operator <<(std::ostream& os, const DataDC::iterator& itr)
// {
// os << itr->first;
// return os;
// }
//*************************************************************************
// std::ostream& operator <<(std::ostream& os, const DataDC::const_iterator& itr)
// {
// os << itr->first;
// return os;
// }
//*************************************************************************
std::ostream& operator <<(std::ostream& os, const DataNDC::iterator& itr)
{
@ -351,6 +335,22 @@ namespace
CHECK(!data.empty());
}
//*************************************************************************
TEST_FIXTURE(SetupFixture, test_constructor_initializer_list)
{
Compare_DataNDC compare_data = { ElementNDC(0, N0), ElementNDC(1, N1), ElementNDC(2, N2), ElementNDC(3, N3), ElementNDC(4, N4) };
DataNDC data = { ElementNDC(0, N0), ElementNDC(1, N1), ElementNDC(2, N2), ElementNDC(3, N3), ElementNDC(4, N4) };
CHECK_EQUAL(compare_data.size(), data.size());
CHECK(!data.empty());
bool isEqual = std::equal(data.begin(),
data.end(),
compare_data.begin());
CHECK(isEqual);
}
//*************************************************************************
TEST_FIXTURE(SetupFixture, test_assignment)
{

View File

@ -215,22 +215,6 @@ namespace
return true;
}
//*************************************************************************
// std::ostream& operator <<(std::ostream& os, const DataDC::iterator& itr)
// {
// os << itr->first;
// return os;
// }
//*************************************************************************
// std::ostream& operator <<(std::ostream& os, const DataDC::const_iterator& itr)
// {
// os << itr->first;
// return os;
// }
//*************************************************************************
std::ostream& operator <<(std::ostream& os, const DataNDC::iterator& itr)
{
@ -326,6 +310,28 @@ namespace
CHECK(data.size() == SIZE);
CHECK(!data.empty());
bool isEqual = std::equal(data.begin(),
data.end(),
compare_data.begin());
CHECK(isEqual);
}
//*************************************************************************
TEST_FIXTURE(SetupFixture, test_constructor_initializer_list)
{
Compare_DataNDC compare_data = { ElementNDC(0, N0), ElementNDC(1, N1), ElementNDC(2, N2), ElementNDC(3, N3), ElementNDC(4, N4) };
DataNDC data = { ElementNDC(0, N0), ElementNDC(1, N1), ElementNDC(2, N2), ElementNDC(3, N3), ElementNDC(4, N4) };
CHECK_EQUAL(compare_data.size(), data.size());
CHECK(!data.empty());
bool isEqual = std::equal(data.begin(),
data.end(),
compare_data.begin());
CHECK(isEqual);
}
//*************************************************************************

View File

@ -281,6 +281,22 @@ namespace
CHECK(!data.empty());
}
//*************************************************************************
TEST_FIXTURE(SetupFixture, test_constructor_initializer_list)
{
Compare_DataNDC compare_data = { N0, N0, N1, N2, N3, N1, N3, N3, N4, N2 };
DataNDC data = { N0, N0, N1, N2, N3, N1, N3, N3, N4, N2 };
CHECK_EQUAL(compare_data.size(), data.size());
CHECK(!data.empty());
bool isEqual = std::equal(data.begin(),
data.end(),
compare_data.begin());
CHECK(isEqual);
}
//*************************************************************************
TEST_FIXTURE(SetupFixture, test_assignment)
{

View File

@ -293,6 +293,22 @@ namespace
CHECK(!data.empty());
}
//*************************************************************************
TEST_FIXTURE(SetupFixture, test_constructor_initializer_list)
{
Compare_DataNDC compare_data = { N0, N1, N2, N3, N4, N5, N6, N7, N8, N9 };
DataNDC data = { N0, N1, N2, N3, N4, N5, N6, N7, N8, N9 };
CHECK_EQUAL(compare_data.size(), data.size());
CHECK(!data.empty());
bool isEqual = std::equal(data.begin(),
data.end(),
compare_data.begin());
CHECK(isEqual);
}
//*************************************************************************
TEST_FIXTURE(SetupFixture, test_assignment)
{

View File

@ -124,9 +124,26 @@ namespace
//*************************************************************************
TEST_FIXTURE(SetupFixture, test_constructor_range)
{
CompareDataNDC compare(sorted_data.begin(), sorted_data.end());
DataNDC data(sorted_data.begin(), sorted_data.end());
CHECK(!data.empty());
are_equal = std::equal(data.begin(), data.end(), compare.begin());
CHECK(are_equal);
}
//*************************************************************************
TEST_FIXTURE(SetupFixture, test_constructor_initializer_list)
{
CompareDataNDC compare = { ItemNDC("0"), ItemNDC("1"), ItemNDC("2"), ItemNDC("3") };
DataNDC data = { ItemNDC("0"), ItemNDC("1"), ItemNDC("2"), ItemNDC("3") };
CHECK(!data.empty());
are_equal = std::equal(data.begin(), data.end(), compare.begin());
CHECK(are_equal);
}
//*************************************************************************

View File

@ -162,6 +162,21 @@ namespace
CHECK(!data.empty());
}
//*************************************************************************
TEST_FIXTURE(SetupFixture, test_constructor_initializer_list)
{
DataNDC data = { ItemNDC("0"), ItemNDC("1"), ItemNDC("2"), ItemNDC("3") };
CHECK_EQUAL(4U, data.size());
DataNDC::const_iterator i_item = data.begin();
CHECK_EQUAL(ItemNDC("0"), *i_item++);
CHECK_EQUAL(ItemNDC("1"), *i_item++);
CHECK_EQUAL(ItemNDC("2"), *i_item++);
CHECK_EQUAL(ItemNDC("3"), *i_item++);
}
//*************************************************************************
TEST_FIXTURE(SetupFixture, test_copy_constructor)
{

View File

@ -206,6 +206,25 @@ namespace
CHECK(!data.empty());
}
//*************************************************************************
TEST_FIXTURE(SetupFixture, test_constructor_initializer_list)
{
Compare_Data compare_data = { Data::value_type(std::string("0"), 0), Data::value_type(std::string("1"), 1),
Data::value_type(std::string("2"), 2), Data::value_type(std::string("3"), 3) };
Data data = { Data::value_type(std::string("0"), 0), Data::value_type(std::string("1"), 1),
Data::value_type(std::string("2"), 2), Data::value_type(std::string("3"), 3) };
CHECK_EQUAL(compare_data.size(), data.size());
CHECK(!data.empty());
bool isEqual = Check_Equal(data.begin(),
data.end(),
compare_data.begin());
CHECK(isEqual);
}
//*************************************************************************
TEST_FIXTURE(SetupFixture, test_assignment)
{

View File

@ -203,6 +203,25 @@ namespace
CHECK(!data.empty());
}
//*************************************************************************
TEST_FIXTURE(SetupFixture, test_constructor_initializer_list)
{
Compare_Data compare_data = { Data::value_type(std::string("0"), 0), Data::value_type(std::string("1"), 1),
Data::value_type(std::string("2"), 2), Data::value_type(std::string("3"), 3) };
Data data = { Data::value_type(std::string("0"), 0), Data::value_type(std::string("1"), 1),
Data::value_type(std::string("2"), 2), Data::value_type(std::string("3"), 3) };
CHECK_EQUAL(compare_data.size(), data.size());
CHECK(!data.empty());
bool isEqual = Check_Equal(data.begin(),
data.end(),
compare_data.begin());
CHECK(isEqual);
}
//*************************************************************************
TEST_FIXTURE(SetupFixture, test_assignment)
{

View File

@ -195,6 +195,20 @@ namespace
CHECK(!data.empty());
}
//*************************************************************************
TEST_FIXTURE(SetupFixture, test_constructor_initializer_list)
{
Compare_Data compare_data = { 0, 1, 1, 3, 4, 4, 6, 7, 7, 9 };
Data data = { 0, 1, 1, 3, 4, 4, 6, 7, 7, 9 };
CHECK_EQUAL(compare_data.size(), data.size());
CHECK(!data.empty());
bool isEqual = std::equal(data.begin(), data.end(), compare_data.begin());
CHECK(isEqual);
}
//*************************************************************************
TEST_FIXTURE(SetupFixture, test_assignment)
{

View File

@ -78,22 +78,6 @@ namespace
return true;
}
//*************************************************************************
// std::ostream& operator <<(std::ostream& os, const DataDC::iterator& itr)
// {
// os << itr->first;
// return os;
// }
//*************************************************************************
// std::ostream& operator <<(std::ostream& os, const DataDC::const_iterator& itr)
// {
// os << itr->first;
// return os;
// }
//*************************************************************************
std::ostream& operator <<(std::ostream& os, const DataNDC::iterator& itr)
{

View File

@ -58,22 +58,6 @@ namespace
typedef std::multimap<int, DC> Compare_DataDC;
typedef std::multimap<int, NDC> Compare_DataNDC;
//*************************************************************************
// std::ostream& operator <<(std::ostream& os, const DataDC::iterator& itr)
// {
// os << itr->first
//
// return os;
// }
//*************************************************************************
// std::ostream& operator <<(std::ostream& os, const DataDC::const_iterator& itr)
// {
// os << itr->first;
//
// return os;
// }
//*************************************************************************
std::ostream& operator <<(std::ostream& os, const DataNDC::iterator& itr)
{

View File

@ -83,22 +83,6 @@ namespace
std::vector<NDC> different_data;
std::vector<NDC> multi_data;
//*************************************************************************
// std::ostream& operator <<(std::ostream& os, const DataDC::iterator& itr)
// {
// os << itr->value;
//
// return os;
// }
//*************************************************************************
// std::ostream& operator <<(std::ostream& os, const DataDC::const_iterator& itr)
// {
// os << itr->value;
//
// return os;
// }
//*************************************************************************
std::ostream& operator <<(std::ostream& os, const DataNDC::iterator& itr)
{

View File

@ -204,6 +204,23 @@ namespace
CHECK(data.size() == MAX_SIZE);
CHECK(!data.empty());
bool isEqual = std::equal(data.begin(), data.end(), compare_data.begin());
CHECK(isEqual);
}
//*************************************************************************
TEST_FIXTURE(SetupFixture, test_constructor_initializer_list)
{
Compare_Data compare_data = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
Data data = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
CHECK_EQUAL(compare_data.size(), data.size());
CHECK(!data.empty());
bool isEqual = std::equal(data.begin(), data.end(), compare_data.begin());
CHECK(isEqual);
}
//*************************************************************************

View File

@ -217,6 +217,16 @@ namespace
CHECK(is_equal);
}
//*************************************************************************
TEST_FIXTURE(SetupFixture, test_construct_initializer_list)
{
Compare_Text compare_text = { STR('H'), STR('e'), STR('l') , STR('l') , STR('o') };
Text text = { STR('H'), STR('e'), STR('l') , STR('l') , STR('o') };
bool is_equal = Equal(compare_text, text);
CHECK(is_equal);
}
//*************************************************************************
TEST_FIXTURE(SetupFixture, test_assignment)
{

View File

@ -216,6 +216,16 @@ namespace
CHECK(is_equal);
}
//*************************************************************************
TEST_FIXTURE(SetupFixture, test_construct_initializer_list)
{
Compare_Text compare_text = { STR('H'), STR('e'), STR('l') , STR('l') , STR('o') };
Text text = { STR('H'), STR('e'), STR('l') , STR('l') , STR('o') };
bool is_equal = Equal(compare_text, text);
CHECK(is_equal);
}
//*************************************************************************
TEST_FIXTURE(SetupFixture, test_assignment)
{

View File

@ -216,6 +216,16 @@ namespace
CHECK(is_equal);
}
//*************************************************************************
TEST_FIXTURE(SetupFixture, test_construct_initializer_list)
{
Compare_Text compare_text = { STR('H'), STR('e'), STR('l') , STR('l') , STR('o') };
Text text = { STR('H'), STR('e'), STR('l') , STR('l') , STR('o') };
bool is_equal = Equal(compare_text, text);
CHECK(is_equal);
}
//*************************************************************************
TEST_FIXTURE(SetupFixture, test_assignment)
{

View File

@ -216,6 +216,16 @@ namespace
CHECK(is_equal);
}
//*************************************************************************
TEST_FIXTURE(SetupFixture, test_construct_initializer_list)
{
Compare_Text compare_text = { STR('H'), STR('e'), STR('l') , STR('l') , STR('o') };
Text text = { STR('H'), STR('e'), STR('l') , STR('l') , STR('o') };
bool is_equal = Equal(compare_text, text);
CHECK(is_equal);
}
//*************************************************************************
TEST_FIXTURE(SetupFixture, test_assignment)
{

View File

@ -142,6 +142,16 @@ namespace
CHECK(!data.empty());
}
//*************************************************************************
TEST(test_constructor_initializer_list)
{
Compare_Data compare_data = { 0, 1, 2, 3 };
Data data = { 0, 1, 2, 3 };
CHECK_EQUAL(compare_data.size(), data.size());
CHECK(std::equal(compare_data.begin(), compare_data.end(), data.begin()));
}
//*************************************************************************
TEST_FIXTURE(SetupFixture, test_copy_constructor)
{

View File

@ -167,6 +167,16 @@ namespace
CHECK(!data.empty());
}
//*************************************************************************
TEST(test_constructor_initializer_list)
{
CompareDataNDC compare_data = { NDC("0"), NDC("1"), NDC("2"), NDC("3") };
DataNDC data = { NDC("0"), NDC("1"), NDC("2"), NDC("3") };
CHECK_EQUAL(compare_data.size(), data.size());
CHECK(std::equal(compare_data.begin(), compare_data.end(), data.begin()));
}
//*************************************************************************
TEST_FIXTURE(SetupFixture, test_copy_constructor)
{

View File

@ -152,6 +152,22 @@ namespace
CHECK(data.size() == SIZE);
CHECK(!data.empty());
CHECK(std::equal(compare_data.begin(), compare_data.end(), data.begin()));
}
//*************************************************************************
TEST(test_constructor_initializer_list)
{
int a = 0;
int b = 1;
int c = 3;
int d = 4;
Compare_Data compare_data = { &a, &b, &c, &d };
Data data = { &a, &b, &c, &d };
CHECK_EQUAL(compare_data.size(), data.size());
CHECK(std::equal(compare_data.begin(), compare_data.end(), data.begin()));
}
//*************************************************************************