Skip to content
Snippets Groups Projects
Commit dfb11ac7 authored by Viktor Wolf's avatar Viktor Wolf
Browse files

replaced deprecated stuff

parent d583a605
Branches
No related tags found
No related merge requests found
...@@ -2,12 +2,13 @@ ...@@ -2,12 +2,13 @@
#include "Serialization/MemoryReader.h" #include "Serialization/MemoryReader.h"
#include "Serialization/MemoryWriter.h" #include "Serialization/MemoryWriter.h"
#include "type_traits"
template <typename ParameterType, typename... RemainingParameterTypes> template <typename ParameterType, typename... RemainingParameterTypes>
inline void SerializeParameters(FMemoryWriter* MemoryWriter, ParameterType&& Parameter, inline void SerializeParameters(FMemoryWriter* MemoryWriter, ParameterType&& Parameter,
RemainingParameterTypes&&... RemainingParameters) RemainingParameterTypes&&... RemainingParameters)
{ {
using NonConstType = typename TRemoveCV<typename TRemoveReference<ParameterType>::Type>::Type; using NonConstType = typename std::remove_cv_t<typename TRemoveReference<ParameterType>::Type>;
// const_cast because the same operator (<<) is used for reading and writing // const_cast because the same operator (<<) is used for reading and writing
(*MemoryWriter) << const_cast<NonConstType&>(Parameter); (*MemoryWriter) << const_cast<NonConstType&>(Parameter);
SerializeParameters(MemoryWriter, Forward<RemainingParameterTypes>(RemainingParameters)...); SerializeParameters(MemoryWriter, Forward<RemainingParameterTypes>(RemainingParameters)...);
...@@ -44,7 +45,7 @@ inline RetType CallDelegateWithParameterMap( ...@@ -44,7 +45,7 @@ inline RetType CallDelegateWithParameterMap(
{ {
// Create a tuple that holds all arguments. This assumes that all argument types are default constructible. However, all // Create a tuple that holds all arguments. This assumes that all argument types are default constructible. However, all
// types that overload the FArchive "<<" operator probably are. // types that overload the FArchive "<<" operator probably are.
TTuple<typename TRemoveCV<typename TRemoveReference<ArgTypes>::Type>::Type...> ArgumentTuple; TTuple<typename std::remove_cv_t<typename TRemoveReference<ArgTypes>::Type>::Type...> ArgumentTuple;
// This call will parse the string map and fill all values in the tuple appropriately. // This call will parse the string map and fill all values in the tuple appropriately.
FillArgumentTuple<0>(&ArgumentTuple, Parameters); FillArgumentTuple<0>(&ArgumentTuple, Parameters);
......
...@@ -69,7 +69,7 @@ public: ...@@ -69,7 +69,7 @@ public:
// Create a tuple that holds all arguments. This assumes that all // Create a tuple that holds all arguments. This assumes that all
// argument types are default constructible. However, all // argument types are default constructible. However, all
// types that overload the FArchive "<<" operator probably are. // types that overload the FArchive "<<" operator probably are.
TTuple<typename TRemoveCV<typename TRemoveReference<ArgTypes>::Type>::Type...> ArgumentTuple; TTuple<typename TRemoveCV<typename TRemoveReference<ArgTypes>::Type>...> ArgumentTuple;
// This call will deserialze the values and fill all values in the tuple appropriately. // This call will deserialze the values and fill all values in the tuple appropriately.
FillArgumentTuple<0>(&MemoryReader, &ArgumentTuple); FillArgumentTuple<0>(&MemoryReader, &ArgumentTuple);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment