mirror of
https://github.com/ETLCPP/etl.git
synced 2026-06-28 05:18:43 +08:00
Make "private" includes relativ (#761)
Avoid "include not found" when indirectly including etl-header Co-authored-by: Andreas Pelczer <pelczer@stoerk-tronic.com>
This commit is contained in:
parent
5aa9333b05
commit
20cfebc8bd
@ -100,17 +100,17 @@ namespace etl
|
||||
public:
|
||||
|
||||
//********************************************
|
||||
#include "etl/private/diagnostic_uninitialized_push.h"
|
||||
#include "private/diagnostic_uninitialized_push.h"
|
||||
message_packet()
|
||||
: valid(false)
|
||||
{
|
||||
}
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
#include "private/diagnostic_pop.h"
|
||||
|
||||
//********************************************
|
||||
///
|
||||
///
|
||||
//********************************************
|
||||
#include "etl/private/diagnostic_uninitialized_push.h"
|
||||
#include "private/diagnostic_uninitialized_push.h"
|
||||
template <typename T>
|
||||
explicit message_packet(T&& msg)
|
||||
: valid(true)
|
||||
@ -142,7 +142,7 @@ namespace etl
|
||||
ETL_STATIC_ASSERT(IsInMessageList<T>, "Message not in packet type list");
|
||||
}
|
||||
}
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
#include "private/diagnostic_pop.h"
|
||||
|
||||
//**********************************************
|
||||
void copy(const message_packet& other)
|
||||
@ -167,7 +167,7 @@ namespace etl
|
||||
}
|
||||
|
||||
//**********************************************
|
||||
#include "etl/private/diagnostic_uninitialized_push.h"
|
||||
#include "private/diagnostic_uninitialized_push.h"
|
||||
message_packet& operator =(const message_packet& rhs)
|
||||
{
|
||||
delete_current_message();
|
||||
@ -179,10 +179,10 @@ namespace etl
|
||||
|
||||
return *this;
|
||||
}
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
#include "private/diagnostic_pop.h"
|
||||
|
||||
//**********************************************
|
||||
#include "etl/private/diagnostic_uninitialized_push.h"
|
||||
#include "private/diagnostic_uninitialized_push.h"
|
||||
message_packet& operator =(message_packet&& rhs)
|
||||
{
|
||||
delete_current_message();
|
||||
@ -194,7 +194,7 @@ namespace etl
|
||||
|
||||
return *this;
|
||||
}
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
#include "private/diagnostic_pop.h"
|
||||
|
||||
//********************************************
|
||||
~message_packet()
|
||||
@ -271,7 +271,7 @@ namespace etl
|
||||
}
|
||||
|
||||
//********************************************
|
||||
#include "etl/private/diagnostic_uninitialized_push.h"
|
||||
#include "private/diagnostic_uninitialized_push.h"
|
||||
void delete_current_message()
|
||||
{
|
||||
if (valid)
|
||||
@ -281,7 +281,7 @@ namespace etl
|
||||
pmsg->~imessage();
|
||||
}
|
||||
}
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
#include "private/diagnostic_pop.h"
|
||||
|
||||
//********************************************
|
||||
void add_new_message(const etl::imessage& msg)
|
||||
@ -295,7 +295,7 @@ namespace etl
|
||||
(add_new_message_type<TMessageTypes>(etl::move(msg)) || ...);
|
||||
}
|
||||
|
||||
#include "etl/private/diagnostic_uninitialized_push.h"
|
||||
#include "private/diagnostic_uninitialized_push.h"
|
||||
//********************************************
|
||||
/// Only enabled for types that are in the typelist.
|
||||
//********************************************
|
||||
@ -306,9 +306,9 @@ namespace etl
|
||||
void* p = data;
|
||||
new (p) etl::remove_reference_t<TMessage>((etl::forward<TMessage>(msg)));
|
||||
}
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
#include "private/diagnostic_pop.h"
|
||||
|
||||
#include "etl/private/diagnostic_uninitialized_push.h"
|
||||
#include "private/diagnostic_uninitialized_push.h"
|
||||
//********************************************
|
||||
template <typename TType>
|
||||
bool add_new_message_type(const etl::imessage& msg)
|
||||
@ -324,7 +324,7 @@ namespace etl
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
#include "private/diagnostic_pop.h"
|
||||
|
||||
//********************************************
|
||||
template <typename TType>
|
||||
@ -398,9 +398,9 @@ namespace etl
|
||||
cog.out(" etl::is_one_of<typename etl::remove_cvref<TMessage>::type,")
|
||||
for i in range(1, n):
|
||||
cog.out("T%d, " % i)
|
||||
cog.outl("T%s>::value);" % n)
|
||||
cog.outl("T%s>::value);" % n)
|
||||
cog.outl("")
|
||||
cog.outl(" ETL_STATIC_ASSERT(Enabled, \"Message not in packet type list\");")
|
||||
cog.outl(" ETL_STATIC_ASSERT(Enabled, \"Message not in packet type list\");")
|
||||
|
||||
################################################
|
||||
def generate_static_assert_cpp11(n):
|
||||
@ -436,15 +436,15 @@ namespace etl
|
||||
cog.outl("public:")
|
||||
cog.outl("")
|
||||
cog.outl(" //********************************************")
|
||||
cog.outl("#include \"etl/private/diagnostic_uninitialized_push.h\"")
|
||||
cog.outl("#include \"private/diagnostic_uninitialized_push.h\"")
|
||||
cog.outl(" message_packet()")
|
||||
cog.outl(" : valid(false)")
|
||||
cog.outl(" {")
|
||||
cog.outl(" }")
|
||||
cog.outl("#include \"etl/private/diagnostic_pop.h\"")
|
||||
cog.outl("#include \"private/diagnostic_pop.h\"")
|
||||
cog.outl("")
|
||||
cog.outl(" //********************************************")
|
||||
cog.outl("#include \"etl/private/diagnostic_uninitialized_push.h\"")
|
||||
cog.outl("#include \"private/diagnostic_uninitialized_push.h\"")
|
||||
cog.outl(" explicit message_packet(const etl::imessage& msg)")
|
||||
cog.outl(" {")
|
||||
cog.outl(" if (accepts(msg))")
|
||||
@ -459,11 +459,11 @@ namespace etl
|
||||
cog.outl("")
|
||||
cog.outl(" ETL_ASSERT(valid, ETL_ERROR(unhandled_message_exception));")
|
||||
cog.outl(" }")
|
||||
cog.outl("#include \"etl/private/diagnostic_pop.h\"")
|
||||
cog.outl("#include \"private/diagnostic_pop.h\"")
|
||||
cog.outl("")
|
||||
cog.outl("#if ETL_USING_CPP11 && !defined(ETL_MESSAGE_PACKET_FORCE_CPP03_IMPLEMENTATION)")
|
||||
cog.outl(" //********************************************")
|
||||
cog.outl("#include \"etl/private/diagnostic_uninitialized_push.h\"")
|
||||
cog.outl("#include \"private/diagnostic_uninitialized_push.h\"")
|
||||
cog.outl(" explicit message_packet(etl::imessage&& msg)")
|
||||
cog.outl(" {")
|
||||
cog.outl(" if (accepts(msg))")
|
||||
@ -478,12 +478,12 @@ namespace etl
|
||||
cog.outl("")
|
||||
cog.outl(" ETL_ASSERT(valid, ETL_ERROR(unhandled_message_exception));")
|
||||
cog.outl(" }")
|
||||
cog.outl("#include \"etl/private/diagnostic_pop.h\"")
|
||||
cog.outl("#include \"private/diagnostic_pop.h\"")
|
||||
cog.outl("#endif")
|
||||
cog.outl("")
|
||||
cog.outl("#if ETL_USING_CPP11 && !defined(ETL_MESSAGE_PACKET_FORCE_CPP03_IMPLEMENTATION) && !defined(ETL_COMPILER_GREEN_HILLS)")
|
||||
cog.outl(" //********************************************")
|
||||
cog.outl("#include \"etl/private/diagnostic_uninitialized_push.h\"")
|
||||
cog.outl("#include \"private/diagnostic_uninitialized_push.h\"")
|
||||
cog.out(" template <typename TMessage, typename = typename etl::enable_if<!etl::is_same<typename etl::remove_cvref<TMessage>::type, etl::message_packet<")
|
||||
for n in range(1, int(Handlers)):
|
||||
cog.out("T%s, " % n)
|
||||
@ -498,10 +498,10 @@ namespace etl
|
||||
cog.outl(" {")
|
||||
generate_static_assert_cpp11(int(Handlers))
|
||||
cog.outl(" }")
|
||||
cog.outl("#include \"etl/private/diagnostic_pop.h\"")
|
||||
cog.outl("#include \"private/diagnostic_pop.h\"")
|
||||
cog.outl("#else")
|
||||
cog.outl(" //********************************************")
|
||||
cog.outl("#include \"etl/private/diagnostic_uninitialized_push.h\"")
|
||||
cog.outl("#include \"private/diagnostic_uninitialized_push.h\"")
|
||||
cog.outl(" template <typename TMessage>")
|
||||
cog.out(" explicit message_packet(const TMessage& /*msg*/, typename etl::enable_if<!etl::is_same<typename etl::remove_cvref<TMessage>::type, etl::message_packet<")
|
||||
for n in range(1, int(Handlers)):
|
||||
@ -516,11 +516,11 @@ namespace etl
|
||||
cog.outl(" {")
|
||||
generate_static_assert_cpp03(int(Handlers))
|
||||
cog.outl(" }")
|
||||
cog.outl("#include \"etl/private/diagnostic_pop.h\"")
|
||||
cog.outl("#include \"private/diagnostic_pop.h\"")
|
||||
cog.outl("#endif")
|
||||
cog.outl("")
|
||||
cog.outl(" //**********************************************")
|
||||
cog.outl("#include \"etl/private/diagnostic_uninitialized_push.h\"")
|
||||
cog.outl("#include \"private/diagnostic_uninitialized_push.h\"")
|
||||
cog.outl(" message_packet(const message_packet& other)")
|
||||
cog.outl(" : valid(other.is_valid())")
|
||||
cog.outl(" {")
|
||||
@ -529,11 +529,11 @@ namespace etl
|
||||
cog.outl(" add_new_message(other.get());")
|
||||
cog.outl(" }")
|
||||
cog.outl(" }")
|
||||
cog.outl("#include \"etl/private/diagnostic_pop.h\"")
|
||||
cog.outl("#include \"private/diagnostic_pop.h\"")
|
||||
cog.outl("")
|
||||
cog.outl("#if ETL_USING_CPP11 && !defined(ETL_MESSAGE_PACKET_FORCE_CPP03_IMPLEMENTATION)")
|
||||
cog.outl(" //**********************************************")
|
||||
cog.outl("#include \"etl/private/diagnostic_uninitialized_push.h\"")
|
||||
cog.outl("#include \"private/diagnostic_uninitialized_push.h\"")
|
||||
cog.outl(" message_packet(message_packet&& other)")
|
||||
cog.outl(" : valid(other.is_valid())")
|
||||
cog.outl(" {")
|
||||
@ -542,11 +542,11 @@ namespace etl
|
||||
cog.outl(" add_new_message(etl::move(other.get()));")
|
||||
cog.outl(" }")
|
||||
cog.outl(" }")
|
||||
cog.outl("#include \"etl/private/diagnostic_pop.h\"")
|
||||
cog.outl("#include \"private/diagnostic_pop.h\"")
|
||||
cog.outl("#endif")
|
||||
cog.outl("")
|
||||
cog.outl(" //**********************************************")
|
||||
cog.outl("#include \"etl/private/diagnostic_uninitialized_push.h\"")
|
||||
cog.outl("#include \"private/diagnostic_uninitialized_push.h\"")
|
||||
cog.outl(" message_packet& operator =(const message_packet& rhs)")
|
||||
cog.outl(" {")
|
||||
cog.outl(" delete_current_message();")
|
||||
@ -558,11 +558,11 @@ namespace etl
|
||||
cog.outl("")
|
||||
cog.outl(" return *this;")
|
||||
cog.outl(" }")
|
||||
cog.outl("#include \"etl/private/diagnostic_pop.h\"")
|
||||
cog.outl("#include \"private/diagnostic_pop.h\"")
|
||||
cog.outl("")
|
||||
cog.outl("#if ETL_USING_CPP11 && !defined(ETL_MESSAGE_PACKET_FORCE_CPP03_IMPLEMENTATION)")
|
||||
cog.outl(" //**********************************************")
|
||||
cog.outl("#include \"etl/private/diagnostic_uninitialized_push.h\"")
|
||||
cog.outl("#include \"private/diagnostic_uninitialized_push.h\"")
|
||||
cog.outl(" message_packet& operator =(message_packet&& rhs)")
|
||||
cog.outl(" {")
|
||||
cog.outl(" delete_current_message();")
|
||||
@ -574,7 +574,7 @@ namespace etl
|
||||
cog.outl("")
|
||||
cog.outl(" return *this;")
|
||||
cog.outl(" }")
|
||||
cog.outl("#include \"etl/private/diagnostic_pop.h\"")
|
||||
cog.outl("#include \"private/diagnostic_pop.h\"")
|
||||
cog.outl("#endif")
|
||||
cog.outl("")
|
||||
cog.outl(" //********************************************")
|
||||
@ -628,7 +628,7 @@ namespace etl
|
||||
cog.outl(" {")
|
||||
generate_accepts_return_compile_time_TMessage(int(Handlers))
|
||||
cog.outl(" }")
|
||||
cog.outl("")
|
||||
cog.outl("")
|
||||
cog.outl(" enum")
|
||||
cog.outl(" {")
|
||||
cog.out(" SIZE = etl::largest<")
|
||||
@ -644,7 +644,7 @@ namespace etl
|
||||
cog.outl("private:")
|
||||
cog.outl("")
|
||||
cog.outl(" //********************************************")
|
||||
cog.outl(" #include \"etl/private/diagnostic_uninitialized_push.h\"")
|
||||
cog.outl(" #include \"private/diagnostic_uninitialized_push.h\"")
|
||||
cog.outl(" void delete_current_message()")
|
||||
cog.outl(" {")
|
||||
cog.outl(" if (valid)")
|
||||
@ -654,7 +654,7 @@ namespace etl
|
||||
cog.outl(" pmsg->~imessage();")
|
||||
cog.outl(" }")
|
||||
cog.outl(" }")
|
||||
cog.outl(" #include \"etl/private/diagnostic_pop.h\"")
|
||||
cog.outl(" #include \"private/diagnostic_pop.h\"")
|
||||
cog.outl("")
|
||||
cog.outl(" //********************************************")
|
||||
cog.outl(" void add_new_message(const etl::imessage& msg)")
|
||||
@ -724,15 +724,15 @@ namespace etl
|
||||
cog.outl("public:")
|
||||
cog.outl("")
|
||||
cog.outl(" //********************************************")
|
||||
cog.outl("#include \"etl/private/diagnostic_uninitialized_push.h\"")
|
||||
cog.outl("#include \"private/diagnostic_uninitialized_push.h\"")
|
||||
cog.outl(" message_packet()")
|
||||
cog.outl(" : valid(false)")
|
||||
cog.outl(" {")
|
||||
cog.outl(" }")
|
||||
cog.outl("#include \"etl/private/diagnostic_pop.h\"")
|
||||
cog.outl("#include \"private/diagnostic_pop.h\"")
|
||||
cog.outl("")
|
||||
cog.outl(" //********************************************")
|
||||
cog.outl("#include \"etl/private/diagnostic_uninitialized_push.h\"")
|
||||
cog.outl("#include \"private/diagnostic_uninitialized_push.h\"")
|
||||
cog.outl(" explicit message_packet(const etl::imessage& msg)")
|
||||
cog.outl(" {")
|
||||
cog.outl(" if (accepts(msg))")
|
||||
@ -747,11 +747,11 @@ namespace etl
|
||||
cog.outl("")
|
||||
cog.outl(" ETL_ASSERT(valid, ETL_ERROR(unhandled_message_exception));")
|
||||
cog.outl(" }")
|
||||
cog.outl("#include \"etl/private/diagnostic_pop.h\"")
|
||||
cog.outl("#include \"private/diagnostic_pop.h\"")
|
||||
cog.outl("")
|
||||
cog.outl("#if ETL_USING_CPP11 && !defined(ETL_MESSAGE_PACKET_FORCE_CPP03_IMPLEMENTATION)")
|
||||
cog.outl(" //********************************************")
|
||||
cog.outl("#include \"etl/private/diagnostic_uninitialized_push.h\"")
|
||||
cog.outl("#include \"private/diagnostic_uninitialized_push.h\"")
|
||||
cog.outl(" explicit message_packet(etl::imessage&& msg)")
|
||||
cog.outl(" {")
|
||||
cog.outl(" if (accepts(msg))")
|
||||
@ -766,12 +766,12 @@ namespace etl
|
||||
cog.outl("")
|
||||
cog.outl(" ETL_ASSERT(valid, ETL_ERROR(unhandled_message_exception));")
|
||||
cog.outl(" }")
|
||||
cog.outl("#include \"etl/private/diagnostic_pop.h\"")
|
||||
cog.outl("#include \"private/diagnostic_pop.h\"")
|
||||
cog.outl("#endif")
|
||||
cog.outl("")
|
||||
cog.outl("#if ETL_USING_CPP11 && !defined(ETL_MESSAGE_PACKET_FORCE_CPP03_IMPLEMENTATION) && !defined(ETL_COMPILER_GREEN_HILLS)")
|
||||
cog.outl(" //********************************************")
|
||||
cog.outl("#include \"etl/private/diagnostic_uninitialized_push.h\"")
|
||||
cog.outl("#include \"private/diagnostic_uninitialized_push.h\"")
|
||||
cog.out(" template <typename TMessage, typename = typename etl::enable_if<!etl::is_same<typename etl::remove_cvref<TMessage>::type, etl::message_packet<")
|
||||
for t in range(1, n):
|
||||
cog.out("T%s, " % t)
|
||||
@ -786,10 +786,10 @@ namespace etl
|
||||
cog.outl(" {")
|
||||
generate_static_assert_cpp11(n)
|
||||
cog.outl(" }")
|
||||
cog.outl("#include \"etl/private/diagnostic_pop.h\"")
|
||||
cog.outl("#include \"private/diagnostic_pop.h\"")
|
||||
cog.outl("#else")
|
||||
cog.outl(" //********************************************")
|
||||
cog.outl("#include \"etl/private/diagnostic_uninitialized_push.h\"")
|
||||
cog.outl("#include \"private/diagnostic_uninitialized_push.h\"")
|
||||
cog.outl(" template <typename TMessage>")
|
||||
cog.out(" explicit message_packet(const TMessage& /*msg*/, typename etl::enable_if<!etl::is_same<typename etl::remove_cvref<TMessage>::type, etl::message_packet<")
|
||||
for t in range(1, n):
|
||||
@ -804,11 +804,11 @@ namespace etl
|
||||
cog.outl(" {")
|
||||
generate_static_assert_cpp03(n)
|
||||
cog.outl(" }")
|
||||
cog.outl("#include \"etl/private/diagnostic_pop.h\"")
|
||||
cog.outl("#include \"private/diagnostic_pop.h\"")
|
||||
cog.outl("#endif")
|
||||
cog.outl("")
|
||||
cog.outl(" //**********************************************")
|
||||
cog.outl("#include \"etl/private/diagnostic_uninitialized_push.h\"")
|
||||
cog.outl("#include \"private/diagnostic_uninitialized_push.h\"")
|
||||
cog.outl(" message_packet(const message_packet& other)")
|
||||
cog.outl(" : valid(other.is_valid())")
|
||||
cog.outl(" {")
|
||||
@ -817,11 +817,11 @@ namespace etl
|
||||
cog.outl(" add_new_message(other.get());")
|
||||
cog.outl(" }")
|
||||
cog.outl(" }")
|
||||
cog.outl("#include \"etl/private/diagnostic_pop.h\"")
|
||||
cog.outl("#include \"private/diagnostic_pop.h\"")
|
||||
cog.outl("")
|
||||
cog.outl("#if ETL_USING_CPP11 && !defined(ETL_MESSAGE_PACKET_FORCE_CPP03_IMPLEMENTATION)")
|
||||
cog.outl(" //**********************************************")
|
||||
cog.outl("#include \"etl/private/diagnostic_uninitialized_push.h\"")
|
||||
cog.outl("#include \"private/diagnostic_uninitialized_push.h\"")
|
||||
cog.outl(" message_packet(message_packet&& other)")
|
||||
cog.outl(" : valid(other.is_valid())")
|
||||
cog.outl(" {")
|
||||
@ -830,11 +830,11 @@ namespace etl
|
||||
cog.outl(" add_new_message(etl::move(other.get()));")
|
||||
cog.outl(" }")
|
||||
cog.outl(" }")
|
||||
cog.outl("#include \"etl/private/diagnostic_pop.h\"")
|
||||
cog.outl("#include \"private/diagnostic_pop.h\"")
|
||||
cog.outl("#endif")
|
||||
cog.outl("")
|
||||
cog.outl(" //**********************************************")
|
||||
cog.outl("#include \"etl/private/diagnostic_uninitialized_push.h\"")
|
||||
cog.outl("#include \"private/diagnostic_uninitialized_push.h\"")
|
||||
cog.outl(" message_packet& operator =(const message_packet& rhs)")
|
||||
cog.outl(" {")
|
||||
cog.outl(" delete_current_message();")
|
||||
@ -846,11 +846,11 @@ namespace etl
|
||||
cog.outl("")
|
||||
cog.outl(" return *this;")
|
||||
cog.outl(" }")
|
||||
cog.outl("#include \"etl/private/diagnostic_pop.h\"")
|
||||
cog.outl("#include \"private/diagnostic_pop.h\"")
|
||||
cog.outl("")
|
||||
cog.outl("#if ETL_USING_CPP11 && !defined(ETL_MESSAGE_PACKET_FORCE_CPP03_IMPLEMENTATION)")
|
||||
cog.outl(" //**********************************************")
|
||||
cog.outl("#include \"etl/private/diagnostic_uninitialized_push.h\"")
|
||||
cog.outl("#include \"private/diagnostic_uninitialized_push.h\"")
|
||||
cog.outl(" message_packet& operator =(message_packet&& rhs)")
|
||||
cog.outl(" {")
|
||||
cog.outl(" delete_current_message();")
|
||||
@ -862,7 +862,7 @@ namespace etl
|
||||
cog.outl("")
|
||||
cog.outl(" return *this;")
|
||||
cog.outl(" }")
|
||||
cog.outl("#include \"etl/private/diagnostic_pop.h\"")
|
||||
cog.outl("#include \"private/diagnostic_pop.h\"")
|
||||
cog.outl("#endif")
|
||||
cog.outl("")
|
||||
cog.outl(" //********************************************")
|
||||
@ -932,7 +932,7 @@ namespace etl
|
||||
cog.outl("private:")
|
||||
cog.outl("")
|
||||
cog.outl(" //********************************************")
|
||||
cog.outl(" #include \"etl/private/diagnostic_uninitialized_push.h\"")
|
||||
cog.outl(" #include \"private/diagnostic_uninitialized_push.h\"")
|
||||
cog.outl(" void delete_current_message()")
|
||||
cog.outl(" {")
|
||||
cog.outl(" if (valid)")
|
||||
@ -942,7 +942,7 @@ namespace etl
|
||||
cog.outl(" pmsg->~imessage();")
|
||||
cog.outl(" }")
|
||||
cog.outl(" }")
|
||||
cog.outl(" #include \"etl/private/diagnostic_pop.h\"")
|
||||
cog.outl(" #include \"private/diagnostic_pop.h\"")
|
||||
cog.outl("")
|
||||
cog.outl(" //********************************************")
|
||||
cog.outl(" void add_new_message(const etl::imessage& msg)")
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -135,7 +135,7 @@ namespace etl
|
||||
{
|
||||
}
|
||||
|
||||
#include "etl/private/diagnostic_uninitialized_push.h"
|
||||
#include "private/diagnostic_uninitialized_push.h"
|
||||
//***************************************************************************
|
||||
/// Copy constructor.
|
||||
//***************************************************************************
|
||||
@ -147,7 +147,7 @@ namespace etl
|
||||
storage.construct(other.value());
|
||||
}
|
||||
}
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
#include "private/diagnostic_pop.h"
|
||||
|
||||
#if ETL_USING_CPP11
|
||||
//***************************************************************************
|
||||
@ -481,7 +481,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
/// Emplaces a value.
|
||||
///\param args The arguments to construct with.
|
||||
//*************************************************************************
|
||||
//*************************************************************************
|
||||
template <typename ... TArgs>
|
||||
ETL_CONSTEXPR20_STL
|
||||
void emplace(TArgs&& ... args)
|
||||
@ -890,7 +890,7 @@ namespace etl
|
||||
//***************************************************************************
|
||||
/// Bool conversion operator.
|
||||
//***************************************************************************
|
||||
ETL_CONSTEXPR14
|
||||
ETL_CONSTEXPR14
|
||||
ETL_EXPLICIT operator bool() const
|
||||
{
|
||||
return valid;
|
||||
@ -1110,7 +1110,7 @@ namespace etl
|
||||
storage_type storage;
|
||||
};
|
||||
|
||||
#include "etl/private/diagnostic_uninitialized_push.h"
|
||||
#include "private/diagnostic_uninitialized_push.h"
|
||||
|
||||
//***************************************************************************
|
||||
/// Equality operator. cppreference 1
|
||||
@ -1404,7 +1404,7 @@ namespace etl
|
||||
return rhs.has_value() ? lhs >= rhs.value() : true;
|
||||
}
|
||||
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
#include "private/diagnostic_pop.h"
|
||||
|
||||
//***************************************************************************
|
||||
/// Make an optional.
|
||||
|
||||
@ -460,12 +460,12 @@ namespace etl
|
||||
/// Default constructor.
|
||||
/// Sets the state of the instance to containing no valid data.
|
||||
//***************************************************************************
|
||||
#include "etl/private/diagnostic_uninitialized_push.h"
|
||||
#include "diagnostic_uninitialized_push.h"
|
||||
variant()
|
||||
: type_id(UNSUPPORTED_TYPE_ID)
|
||||
{
|
||||
}
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
#include "diagnostic_pop.h"
|
||||
|
||||
//***************************************************************************
|
||||
/// Constructor that catches any types that are not supported.
|
||||
@ -484,7 +484,7 @@ namespace etl
|
||||
/// Copy constructor.
|
||||
///\param other The other variant object to copy.
|
||||
//***************************************************************************
|
||||
#include "etl/private/diagnostic_uninitialized_push.h"
|
||||
#include "diagnostic_uninitialized_push.h"
|
||||
variant(const variant& other)
|
||||
{
|
||||
switch (other.type_id)
|
||||
@ -502,7 +502,7 @@ namespace etl
|
||||
|
||||
type_id = other.type_id;
|
||||
}
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
#include "diagnostic_pop.h"
|
||||
|
||||
#if ETL_USING_CPP11 && ETL_NOT_USING_STLPORT && !defined(ETL_VARIANT_FORCE_CPP03_IMPLEMENTATION)
|
||||
//*************************************************************************
|
||||
@ -869,8 +869,7 @@ namespace etl
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
#include "etl/private/diagnostic_uninitialized_push.h"
|
||||
#include "diagnostic_uninitialized_push.h"
|
||||
//***************************************************************************
|
||||
/// Destruct the current occupant of the variant.
|
||||
//***************************************************************************
|
||||
@ -891,7 +890,7 @@ namespace etl
|
||||
|
||||
type_id = UNSUPPORTED_TYPE_ID;
|
||||
}
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
#include "diagnostic_pop.h"
|
||||
|
||||
//***************************************************************************
|
||||
/// The internal storage.
|
||||
@ -1010,4 +1009,3 @@ namespace etl
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -430,7 +430,7 @@ namespace etl
|
||||
/// 'Bad variant access' exception for the variant class.
|
||||
///\ingroup variant
|
||||
//***************************************************************************
|
||||
class bad_variant_access : public variant_exception
|
||||
class bad_variant_access : public variant_exception
|
||||
{
|
||||
public:
|
||||
bad_variant_access(string_type file_name_, numeric_type line_number_)
|
||||
@ -524,7 +524,7 @@ namespace etl
|
||||
/// Default constructor.
|
||||
/// Sets the state of the instance to containing no valid data.
|
||||
//***************************************************************************
|
||||
#include "etl/private/diagnostic_uninitialized_push.h"
|
||||
#include "diagnostic_uninitialized_push.h"
|
||||
ETL_CONSTEXPR14 variant()
|
||||
{
|
||||
using type = typename etl::private_variant::parameter_pack<TTypes...>::template type_from_index<0U>::type;
|
||||
@ -533,12 +533,12 @@ namespace etl
|
||||
operation = operation_type<type, etl::is_copy_constructible<type>::value, etl::is_move_constructible<type>::value>::do_operation;
|
||||
type_id = 0U;
|
||||
}
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
#include "diagnostic_pop.h"
|
||||
|
||||
//***************************************************************************
|
||||
/// Construct from a value.
|
||||
//***************************************************************************
|
||||
#include "etl/private/diagnostic_uninitialized_push.h"
|
||||
#include "diagnostic_uninitialized_push.h"
|
||||
template <typename T, etl::enable_if_t<!etl::is_same<etl::remove_cvref_t<T>, variant>::value, int> = 0>
|
||||
ETL_CONSTEXPR14 variant(T&& value)
|
||||
: operation(operation_type<etl::remove_cvref_t<T>, etl::is_copy_constructible<etl::remove_cvref_t<T>>::value, etl::is_move_constructible<etl::remove_cvref_t<T>>::value>::do_operation)
|
||||
@ -548,12 +548,12 @@ namespace etl
|
||||
|
||||
construct_in_place<etl::remove_cvref_t<T>>(data, etl::forward<T>(value));
|
||||
}
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
#include "diagnostic_pop.h"
|
||||
|
||||
//***************************************************************************
|
||||
/// Construct from arguments.
|
||||
//***************************************************************************
|
||||
#include "etl/private/diagnostic_uninitialized_push.h"
|
||||
#include "diagnostic_uninitialized_push.h"
|
||||
template <typename T, typename... TArgs>
|
||||
ETL_CONSTEXPR14 explicit variant(etl::in_place_type_t<T>, TArgs&&... args)
|
||||
: operation(operation_type<etl::remove_cvref_t<T>, etl::is_copy_constructible<etl::remove_cvref_t<T>>::value, etl::is_move_constructible<etl::remove_cvref_t<T>>::value>::do_operation)
|
||||
@ -563,12 +563,12 @@ namespace etl
|
||||
|
||||
construct_in_place_args<etl::remove_cvref_t<T>>(data, etl::forward<TArgs>(args)...);
|
||||
}
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
#include "diagnostic_pop.h"
|
||||
|
||||
//***************************************************************************
|
||||
/// Construct from arguments.
|
||||
//***************************************************************************
|
||||
#include "etl/private/diagnostic_uninitialized_push.h"
|
||||
#include "diagnostic_uninitialized_push.h"
|
||||
template <size_t Index, typename... TArgs>
|
||||
ETL_CONSTEXPR14 explicit variant(etl::in_place_index_t<Index>, TArgs&&... args)
|
||||
: type_id(Index)
|
||||
@ -580,13 +580,13 @@ namespace etl
|
||||
|
||||
operation = operation_type<type, etl::is_copy_constructible<type>::value, etl::is_move_constructible<type>::value>::do_operation;
|
||||
}
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
#include "diagnostic_pop.h"
|
||||
|
||||
#if ETL_HAS_INITIALIZER_LIST
|
||||
//***************************************************************************
|
||||
/// Construct from type, initializer_list and arguments.
|
||||
//***************************************************************************
|
||||
#include "etl/private/diagnostic_uninitialized_push.h"
|
||||
#include "diagnostic_uninitialized_push.h"
|
||||
template <typename T, typename U, typename... TArgs >
|
||||
ETL_CONSTEXPR14 explicit variant(etl::in_place_type_t<T>, std::initializer_list<U> init, TArgs&&... args)
|
||||
: operation(operation_type<etl::remove_cvref_t<T>, etl::is_copy_constructible<etl::remove_cvref_t<T>>::value, etl::is_move_constructible<etl::remove_cvref_t<T>>::value>::do_operation)
|
||||
@ -596,12 +596,12 @@ namespace etl
|
||||
|
||||
construct_in_place_args<etl::remove_cvref_t<T>>(data, init, etl::forward<TArgs>(args)...);
|
||||
}
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
#include "diagnostic_pop.h"
|
||||
|
||||
//***************************************************************************
|
||||
/// Construct from index, initializer_list and arguments.
|
||||
//***************************************************************************
|
||||
#include "etl/private/diagnostic_uninitialized_push.h"
|
||||
#include "diagnostic_uninitialized_push.h"
|
||||
template <size_t Index, typename U, typename... TArgs >
|
||||
ETL_CONSTEXPR14 explicit variant(etl::in_place_index_t<Index>, std::initializer_list<U> init, TArgs&&... args)
|
||||
: type_id(Index)
|
||||
@ -613,14 +613,14 @@ namespace etl
|
||||
|
||||
operation = operation_type<type, etl::is_copy_constructible<type>::value, etl::is_move_constructible<type>::value>::do_operation;
|
||||
}
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
#include "diagnostic_pop.h"
|
||||
#endif
|
||||
|
||||
//***************************************************************************
|
||||
/// Copy constructor.
|
||||
///\param other The other variant object to copy.
|
||||
//***************************************************************************
|
||||
#include "etl/private/diagnostic_uninitialized_push.h"
|
||||
#include "diagnostic_uninitialized_push.h"
|
||||
ETL_CONSTEXPR14 variant(const variant& other)
|
||||
: operation(other.operation)
|
||||
, type_id(other.type_id)
|
||||
@ -637,13 +637,13 @@ namespace etl
|
||||
}
|
||||
}
|
||||
}
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
#include "diagnostic_pop.h"
|
||||
|
||||
//***************************************************************************
|
||||
/// Move constructor.
|
||||
///\param other The other variant object to copy.
|
||||
//***************************************************************************
|
||||
#include "etl/private/diagnostic_uninitialized_push.h"
|
||||
#include "diagnostic_uninitialized_push.h"
|
||||
ETL_CONSTEXPR14 variant(variant&& other)
|
||||
: operation(other.operation)
|
||||
, type_id(other.type_id)
|
||||
@ -664,7 +664,7 @@ namespace etl
|
||||
type_id = variant_npos;
|
||||
}
|
||||
}
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
#include "diagnostic_pop.h"
|
||||
|
||||
//***************************************************************************
|
||||
/// Destructor.
|
||||
@ -706,7 +706,7 @@ namespace etl
|
||||
//***************************************************************************
|
||||
template <size_t Index, typename... TArgs>
|
||||
typename etl::variant_alternative<Index, variant<TArgs...>>::type& emplace(TArgs&&... args)
|
||||
{
|
||||
{
|
||||
static_assert(Index < etl::private_variant::parameter_pack<TTypes...>::size, "Index out of range");
|
||||
|
||||
using type = typename etl::private_variant::parameter_pack<TTypes...>::template type_from_index<Index>::type;
|
||||
@ -826,7 +826,7 @@ namespace etl
|
||||
/// Accept an etl::visitor.
|
||||
//***************************************************************************
|
||||
template <typename TVisitor>
|
||||
etl::enable_if_t<etl::is_visitor<TVisitor>::value, void>
|
||||
etl::enable_if_t<etl::is_visitor<TVisitor>::value, void>
|
||||
accept(TVisitor& v)
|
||||
{
|
||||
#if ETL_USING_CPP17 && !defined(ETL_VARIANT_FORCE_CPP11)
|
||||
@ -840,7 +840,7 @@ namespace etl
|
||||
/// Accept an etl::visitor.
|
||||
//***************************************************************************
|
||||
template <typename TVisitor>
|
||||
etl::enable_if_t<etl::is_visitor<TVisitor>::value, void>
|
||||
etl::enable_if_t<etl::is_visitor<TVisitor>::value, void>
|
||||
accept(TVisitor& v) const
|
||||
{
|
||||
#if ETL_USING_CPP17 && !defined(ETL_VARIANT_FORCE_CPP11)
|
||||
@ -1125,7 +1125,7 @@ namespace etl
|
||||
{
|
||||
// Workaround for MSVC (2023/05/13)
|
||||
// It doesn't compile 'visitor.visit(etl::get<Index>(*this))' correctly for C++17 & C++20.
|
||||
// Changed all of the instances for consistancy.
|
||||
// Changed all of the instances for consistancy.
|
||||
auto& v = etl::get<Index>(*this);
|
||||
visitor.visit(v);
|
||||
return true;
|
||||
@ -1146,7 +1146,7 @@ namespace etl
|
||||
{
|
||||
// Workaround for MSVC (2023/05/13)
|
||||
// It doesn't compile 'visitor.visit(etl::get<Index>(*this))' correctly for C++17 & C++20.
|
||||
// Changed all of the instances for consistancy.
|
||||
// Changed all of the instances for consistancy.
|
||||
auto& v = etl::get<Index>(*this);
|
||||
visitor.visit(v);
|
||||
return true;
|
||||
@ -1700,7 +1700,7 @@ namespace etl
|
||||
struct do_visit_helper
|
||||
{
|
||||
using function_pointer = add_pointer_t<TRet(TCallable&&, TCurVariant&&, TVarRest&&...)>;
|
||||
|
||||
|
||||
template <size_t tIndex>
|
||||
static constexpr function_pointer fptr() noexcept
|
||||
{
|
||||
@ -1715,10 +1715,10 @@ namespace etl
|
||||
static ETL_CONSTEXPR14 TRet do_visit(TCallable&& f, TVariant&& v, index_sequence<tIndices...>, TVarRest&&... variants)
|
||||
{
|
||||
ETL_ASSERT(!v.valueless_by_exception(), ETL_ERROR(bad_variant_access));
|
||||
|
||||
|
||||
using helper_t = do_visit_helper<TRet, TCallable, TVariant, TVarRest...>;
|
||||
using func_ptr = typename helper_t::function_pointer;
|
||||
|
||||
|
||||
constexpr func_ptr jmp_table[]
|
||||
{
|
||||
helper_t::template fptr<tIndices>()...
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
#755 warning about constexpr in array.h
|
||||
#756 Parameter pack compilation error
|
||||
#758 Move assignment not working for non-empty containers
|
||||
#761 Make "private" includes relative
|
||||
Re-enabled bit_stream_writer tests
|
||||
|
||||
===============================================================================
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user