Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
John Wellbelove committed Dec 18, 2015
2 parents 57011fc + d96a10c commit 831d5dc
Show file tree
Hide file tree
Showing 28 changed files with 3,259 additions and 382 deletions.
16 changes: 8 additions & 8 deletions error_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,17 @@ namespace etl
///\ingroup error_handler
//***************************************************************************
#if defined(ETL_NO_CHECKS)
#define ETL_ASSERT(b, e) (true) // Does nothing. Evaluates to 'true'.
#define ETL_ASSERT(b, e) (true) // Does nothing. Evaluates to 'true'.
#elif defined(ETL_THROW_EXCEPTIONS)
#define ETL_ASSERT(b, e) (((b) ? true : throw((e))), true) // Throws an exception if the condition fails. Evaluates to 'true'.
#define ETL_ASSERT(b, e) (((b) ? true : throw((e))), true) // Throws an exception if the condition fails. Evaluates to 'true'.
#elif defined(ETL_LOG_ERRORS)
#define ETL_ASSERT(b, e) (((b) ? true : etl::error_handler::error((e))), (b)) // Logs the error if the condition fails. Evaluates to the result of the condition.
#define ETL_ASSERT(b, e) (((b) ? true : etl::error_handler::error((e))), (b)) // Logs the error if the condition fails. Evaluates to the result of the condition.
#else
#if defined(NDEBUG)
#define ETL_ASSERT(b, e) (true) // Does nothing. Evaluates to 'true'.
#elif
#define ETL_ASSERT(b, e) ((assert((b))), true) // Asserts if the condition fails. Evaluates to 'true'.
#endif
#if defined(NDEBUG)
#define ETL_ASSERT(b, e) (true) // Does nothing. Evaluates to 'true'.
#else
#define ETL_ASSERT(b, e) ((assert((b))), true) // Asserts if the condition fails. Evaluates to 'true'.
#endif
#endif

#if defined(ETL_VERBOSE_ERRORS)
Expand Down
2 changes: 1 addition & 1 deletion flat_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ SOFTWARE.

namespace etl
{
template <typename TKey, typename TValue, const size_t MAX_SIZE_, typename TCompare = std::less<TKey>>
template <typename TKey, typename TValue, const size_t MAX_SIZE_, typename TCompare = std::less<TKey> >
//***************************************************************************
/// A flat_map implementation that uses a fixed size buffer.
///\tparam TKey The key type.
Expand Down
2 changes: 1 addition & 1 deletion flat_multimap.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ SOFTWARE.

namespace etl
{
template <typename TKey, typename TValue, const size_t MAX_SIZE_, typename TCompare = std::less<TKey>>
template <typename TKey, typename TValue, const size_t MAX_SIZE_, typename TCompare = std::less<TKey> >
//***************************************************************************
/// A flat_multimap implementation that uses a fixed size buffer.
///\tparam TKey The key type.
Expand Down
2 changes: 1 addition & 1 deletion flat_multiset.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ SOFTWARE.

namespace etl
{
template <typename T, const size_t MAX_SIZE_, typename TCompare = std::less<T>>
template <typename T, const size_t MAX_SIZE_, typename TCompare = std::less<T> >
//***************************************************************************
/// A flat_multiset implementation that uses a fixed size buffer.
///\tparam T The value type.
Expand Down
2 changes: 1 addition & 1 deletion flat_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ SOFTWARE.

namespace etl
{
template <typename T, const size_t MAX_SIZE_, typename TCompare = std::less<T>>
template <typename T, const size_t MAX_SIZE_, typename TCompare = std::less<T> >
//***************************************************************************
/// A flat_set implementation that uses a fixed size buffer.
///\tparam T The value type.
Expand Down
2 changes: 1 addition & 1 deletion iflat_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ namespace etl
/// Can be used as a reference type for all flat_maps containing a specific type.
///\ingroup flat_map
//***************************************************************************
template <typename TKey, typename TMapped, typename TKeyCompare = std::less<TKey>>
template <typename TKey, typename TMapped, typename TKeyCompare = std::less<TKey> >
class iflat_map : public flat_map_base
{
public:
Expand Down
2 changes: 1 addition & 1 deletion iflat_multimap.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ namespace etl
/// Can be used as a reference type for all flat_multimaps containing a specific type.
///\ingroup flat_multimap
//***************************************************************************
template <typename TKey, typename TMapped, typename TKeyCompare = std::less<TKey>>
template <typename TKey, typename TMapped, typename TKeyCompare = std::less<TKey> >
class iflat_multimap : public flat_multimap_base
{
public:
Expand Down
2 changes: 1 addition & 1 deletion iflat_multiset.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ namespace etl
/// Can be used as a reference type for all flat_multisets containing a specific type.
///\ingroup flat_multiset
//***************************************************************************
template <typename T, typename TKeyCompare = std::less<T>>
template <typename T, typename TKeyCompare = std::less<T> >
class iflat_multiset : public flat_multiset_base
{
private:
Expand Down
19 changes: 14 additions & 5 deletions iflat_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ namespace etl
/// Can be used as a reference type for all flat_sets containing a specific type.
///\ingroup flat_set
//***************************************************************************
template <typename T, typename TKeyCompare = std::less<T>>
template <typename T, typename TKeyCompare = std::less<T> >
class iflat_set : public flat_set_base
{
private:
Expand Down Expand Up @@ -226,17 +226,26 @@ namespace etl

if (i_element == end())
{
// At the end.
// At the end. Doesn't exist.
buffer.push_back(value);
result.first = end() - 1;
result.second = true;
}
else
{
// Not at the end.
buffer.insert(i_element, value);
result.first = i_element;
result.second = true;
// Does not exist already?
if (*i_element != value)
{
buffer.insert(i_element, value);
result.first = i_element;
result.second = true;
}
else
{
result.first = i_element;
result.second = false;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion map.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ namespace etl
//*************************************************************************
/// A templated map implementation that uses a fixed size buffer.
//*************************************************************************
template <typename TKey, typename TValue, const size_t MAX_SIZE_, typename TCompare = std::less<TKey>>
template <typename TKey, typename TValue, const size_t MAX_SIZE_, typename TCompare = std::less<TKey> >
class map : public imap<TKey, TValue, TCompare>
{
public:
Expand Down
2 changes: 1 addition & 1 deletion multimap.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ namespace etl
//*************************************************************************
/// A templated multimap implementation that uses a fixed size buffer.
//*************************************************************************
template <typename TKey, typename TValue, const size_t MAX_SIZE_, typename TCompare = std::less<TKey>>
template <typename TKey, typename TValue, const size_t MAX_SIZE_, typename TCompare = std::less<TKey> >
class multimap : public imultimap<TKey, TValue, TCompare>
{
public:
Expand Down
2 changes: 1 addition & 1 deletion multiset.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ namespace etl
//*************************************************************************
/// A templated multiset implementation that uses a fixed size buffer.
//*************************************************************************
template <typename T, const size_t MAX_SIZE_, typename TCompare = std::less<TKey>>
template <typename T, const size_t MAX_SIZE_, typename TCompare = std::less<TKey> >
class multiset : public imultiset<T, TCompare>
{
public:
Expand Down
2 changes: 1 addition & 1 deletion set.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ namespace etl
//*************************************************************************
/// A templated set implementation that uses a fixed size buffer.
//*************************************************************************
template <typename T, const size_t MAX_SIZE_, typename TCompare = std::less<T>>
template <typename T, const size_t MAX_SIZE_, typename TCompare = std::less<T> >
class set : public iset<T, TCompare>
{
public:
Expand Down
Loading

0 comments on commit 831d5dc

Please sign in to comment.