Updates to mem_cast

This commit is contained in:
John Wellbelove 2021-05-31 10:00:01 +01:00
parent 8af219c0b3
commit b19471dc8a
10 changed files with 59 additions and 15 deletions

View File

@ -34,22 +34,22 @@ SOFTWARE.
#include <stdint.h>
#include <string.h>
#include "../platform.h"
#include "../memory.h"
#include "../static_assert.h"
#include "../largest.h"
#include "../utility.h"
#include "../placement_new.h"
#include "../exception.h"
#include "../error_handler.h"
#include "../file_error_numbers.h"
#include "platform.h"
#include "memory.h"
#include "static_assert.h"
#include "largest.h"
#include "utility.h"
#include "placement_new.h"
#include "exception.h"
#include "error_handler.h"
#include "file_error_numbers.h"
namespace etl
{
//***************************************************************************
/// The base class for array_wrapper exceptions.
//***************************************************************************
class mem_cast_exception : public exception
class mem_cast_exception : public etl::exception
{
public:
@ -62,7 +62,7 @@ namespace etl
//***************************************************************************
/// The exception thrown when the buffer pointer alignment is not compatible.
//***************************************************************************
class mem_cast_alignment_exception : public mem_cast_exception
class mem_cast_alignment_exception : public etl::mem_cast_exception
{
public:
@ -75,7 +75,7 @@ namespace etl
//***************************************************************************
/// The exception thrown when the pointer is null.
//***************************************************************************
class mem_cast_nullptr_exception : public mem_cast_exception
class mem_cast_nullptr_exception : public etl::mem_cast_exception
{
public:

View File

@ -151,6 +151,7 @@ target_sources(t98 PRIVATE etl_profile.h
../map.h.t.cpp
../math_constants.h.t.cpp
../mean.h.t.cpp
../mem_cast.h.t.cpp
../memory.h.t.cpp
../memory_model.h.t.cpp
../message.h.t.cpp

View File

@ -151,6 +151,7 @@ target_sources(t11 PRIVATE etl_profile.h
../map.h.t.cpp
../math_constants.h.t.cpp
../mean.h.t.cpp
../mem_cast.h.t.cpp
../memory.h.t.cpp
../memory_model.h.t.cpp
../message.h.t.cpp

View File

@ -151,6 +151,7 @@ target_sources(t14 PRIVATE etl_profile.h
../map.h.t.cpp
../math_constants.h.t.cpp
../mean.h.t.cpp
../mem_cast.h.t.cpp
../memory.h.t.cpp
../memory_model.h.t.cpp
../message.h.t.cpp

View File

@ -151,6 +151,7 @@ target_sources(t17 PRIVATE etl_profile.h
../map.h.t.cpp
../math_constants.h.t.cpp
../mean.h.t.cpp
../mem_cast.h.t.cpp
../memory.h.t.cpp
../memory_model.h.t.cpp
../message.h.t.cpp

View File

@ -0,0 +1,29 @@
/******************************************************************************
The MIT License(MIT)
Embedded Template Library.
https://github.com/ETLCPP/etl
https://www.etlcpp.com
Copyright(c) 2021 John Wellbelove
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files(the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions :
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
******************************************************************************/
#include <etl/mem_cast.h>

View File

@ -28,7 +28,7 @@ SOFTWARE.
#include "unit_test_framework.h"
#include "etl/experimental/mem_cast.h"
#include "etl/mem_cast.h"
#include "etl/largest.h"
#include <array>

View File

@ -28,7 +28,7 @@ SOFTWARE.
#include "unit_test_framework.h"
#include "etl/experimental/mem_cast.h"
#include "etl/mem_cast.h"
#include "etl/largest.h"
#include <array>

View File

@ -3231,6 +3231,14 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugNoSTLForceNoAdvanced|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\sanity-check\mem_cast.h.t.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugNoSTL|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug LLVM|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugLLVMNoSTL|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug64|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug MSVC No Checks|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\sanity-check\message.h.t.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugNoSTL|Win32'">true</ExcludedFromBuild>

View File

@ -1111,7 +1111,7 @@
<Filter>ETL\Private</Filter>
</ClInclude>
<ClInclude Include="..\..\include\etl\experimental\mem_cast.h">
<Filter>ETL\Experimental</Filter>
<Filter>ETL\Utilities</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
@ -2540,6 +2540,9 @@
<ClCompile Include="..\test_mem_cast_ptr.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\mem_cast.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="..\..\library.properties">