From 2b5fe55540203dbb0061c45d955a675a053ecdc4 Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Sat, 20 Apr 2019 11:14:24 +0100 Subject: [PATCH] First code, no unit tests --- include/etl/multi_array.h | 75 +++++++++++++++++++++++++++++++++ test/vs2017/etl.vcxproj | 1 + test/vs2017/etl.vcxproj.filters | 3 ++ 3 files changed, 79 insertions(+) create mode 100644 include/etl/multi_array.h diff --git a/include/etl/multi_array.h b/include/etl/multi_array.h new file mode 100644 index 00000000..86f28ce3 --- /dev/null +++ b/include/etl/multi_array.h @@ -0,0 +1,75 @@ +///\file + +/****************************************************************************** +The MIT License(MIT) + +Embedded Template Library. +https://github.com/ETLCPP/etl +https://www.etlcpp.com + +Copyright(c) 2019 jwellbelove + +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. +******************************************************************************/ + +#ifndef ETL_MULTI_ARRAY_INCLUDED +#define ETL_MULTI_ARRAY_INCLUDED + +#include "platform.h" +#include "array.h" + +///\defgroup multi_array multi_array +/// A multi dimentional array. +///\ingroup containers + +namespace etl +{ + +#if ETL_CPP11_SUPPORTED + + namespace private_multi_array + { + template + struct multi_array_t + { + using ArrayX = typename multi_array_t::type; + using type = etl::array; + }; + + template + struct multi_array_t + { + using type = etl::array; + }; + } + + template + using multi_array = private_multi_array::multi_array_t; + + template + using array2d = etl::multi_array; + + template + using array3d = etl::multi_array; + +#endif +} + +#endif + diff --git a/test/vs2017/etl.vcxproj b/test/vs2017/etl.vcxproj index 892c2035..ad876c13 100644 --- a/test/vs2017/etl.vcxproj +++ b/test/vs2017/etl.vcxproj @@ -379,6 +379,7 @@ + diff --git a/test/vs2017/etl.vcxproj.filters b/test/vs2017/etl.vcxproj.filters index b89c8cf5..69d55f04 100644 --- a/test/vs2017/etl.vcxproj.filters +++ b/test/vs2017/etl.vcxproj.filters @@ -765,6 +765,9 @@ ETL\Utilities + + ETL\Containers +