Skip to content

Commit

Permalink
Work-In-Progress for full implementation of etl::expected
Browse files Browse the repository at this point in the history
fix set of ETL_NO_STL flag (#628)

Co-authored-by: Sergey Skorokhod <s.skorokhod@1440.space>

Removed duplicate include

unique_ptr updates - Work in progress

Updated versions & memory.h

Fix duplicate function

Fixed incorrect 'valid' flag in assignment operator for arithmetic specialisation

Updated version and release notes

Fix bug #636 in optional emplace for pod types (#638)

Updated version info

Updated generator test script

Only build tests if top level project (#639)

Removed trailing spaces

Updated version info

Incorrect C++03 enable_if syntax

Updated version info

Don't use `push_macro` and `pull_macro` with Tasking compiler (#643)

* Autodetect Tasking compiler

#642

* Don't use `push_macro` and `pop_macro` for Tasking compiler

#642

Co-authored-by: Todd Snider <tsnider@jlg.com>

#643 Don't use push_macro and pull_macro with Tasking compiler

Updated etl::delgate to handle const functors correctly

Updated version info

Fixed functor delegate enable_if

Updated release notes

Avoid 'missing return statement at end of non-void function' in `etl::visit<>()`. (#645)

* Avoid 'missing return statement at end of non-void function' in `etl::visit<>()`.

For some definitions of `ETL_ASSERT()` there may be no return statement in case of an invalid type.
This results in undefined behavior.

Warning[Pe940]: missing return statement at end of non-void function "etl::visit<TReturn,TVisitor,TVariant>(TVisitor &, TVariant const &) include\etl\private\variant_legacy.h 976

* Use more self-explaining code.

Substitute ET_ASSERT() and return by dedicated macro.
This moves the responsibility of how to handle errors to the dedicated place.

improve is_constructible, is_copy_constructible, is_move_constructible for type traits with default definitions (#648)

Removed unused ETL_USE_MEM_BUILTINS option

Updated version info

Updated release notes

Added etl::result<TValue, void> specialisation

Reverted code for etl::result<void, TError> specialisation

Added etl::result<TValue, void> specialisation

Reverted code for etl::result<void, TError> specialisation

Fixed perfect forwarding for make_xxx helper functions

Don't warn on tag missing when subproject (#653) (#655)

Different solution than proposed in the issue, since that proposed
solution would given unexpected results when an intermediate
(untagged) commit is checked out.

This change simply skips warning about a missing git version when this
is a subproject, and uses the original version calculation logic.

I've also renamed `determine_version` to `determine_version_with_file`.
I'd originally done this in an intermediate version of this PR, but I
think that keeping the renaming is clearer code.

Removed superfluous semicolons

Updated version and release notes

Removed testing for 18.04

Added testing for 22.04

Updated Github Actions for Clang

Updated version and release notes

clang updates for Github Actions

Added missing notes

emplace member functions return reference to emplaced value (#659)

emplace_front, emplace_back updates

Updated version and release info

Improved emplace testing

Changed unit test macro CHECK_FALSE_EQUAL to CHECK_NOT_EQUAL

Improved emplace testing

Changed unit test macro CHECK_FALSE_EQUAL to CHECK_NOT_EQUAL

Improved emplace testing

Work-In-Progress

Work-In-Progress

Added indexed emplace

More typedefs for etl::result

Work in progress

Work in progress

Work in progress

Changed default constructor

Added function comments
  • Loading branch information
jwellbelove committed Jan 21, 2023
1 parent 04bbf01 commit 5fb3e4c
Show file tree
Hide file tree
Showing 64 changed files with 2,530 additions and 747 deletions.
38 changes: 18 additions & 20 deletions .github/workflows/clang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ on:
branches: [ master ]

jobs:
build-clang-9-linux-stl:
name: Clang-9 Linux - STL
build-clang-linux-stl:
name: Clang Linux - STL
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
os: [ubuntu-20.04, ubuntu-22.04]

steps:
- uses: actions/checkout@v2

- name: Build
run: |
sudo apt-get update
sudo apt-get install -y "clang-9" "lldb-9" "lld-9" "clang-format-9"
export CC=clang-9
export CXX=clang++-9
sudo apt-get install -y "clang" "lldb" "lld" "clang-format"
export CC=clang
export CXX=clang++
export ASAN_OPTIONS=alloc_dealloc_mismatch=0,detect_leaks=0
git fetch --tags
cmake -D BUILD_TESTS=ON -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03=OFF ./
Expand All @@ -31,49 +31,47 @@ jobs:
- name: Run tests
run: ./test/etl_tests

build-clang-9-linux-no-stl:
name: Clang-9 Linux - No STL
build-clang-linux-no-stl:
name: Clang Linux - No STL
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
os: [ubuntu-20.04, ubuntu-22.04]

steps:
- uses: actions/checkout@v2

- name: Build
run: |
sudo apt-get update
sudo apt-get install -y "clang-9" "lldb-9" "lld-9" "clang-format-9"
export CC=clang-9
export CXX=clang++-9
sudo apt-get install -y "clang" "lldb" "lld" "clang-format"
export CC=clang
export CXX=clang++
export ASAN_OPTIONS=alloc_dealloc_mismatch=0,detect_leaks=0
git fetch --tags
cmake -DBUILD_TESTS=ON -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03=OFF ./
gcc --version
cmake -D BUILD_TESTS=ON -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03=OFF ./
clang --version
make
- name: Run tests
run: ./test/etl_tests

build-clang-9-linux-stl-force-cpp03:
name: Clang-9 Linux - STL - Force C++03
build-clang-linux-stl-force-cpp03:
name: Clang Linux - STL - Force C++03
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
os: [ubuntu-20.04, ubuntu-22.04]

steps:
- uses: actions/checkout@v2

- name: Build
run: |
sudo apt-get update
sudo apt-get install -y "clang-9" "lldb-9" "lld-9" "clang-format-9"
export CC=clang-9
export CXX=clang++-9
sudo apt-get install -y "clang" "lldb" "lld" "clang-format"
export CC=clang
export CXX=clang++
export ASAN_OPTIONS=alloc_dealloc_mismatch=0,detect_leaks=0
git fetch --tags
cmake -D BUILD_TESTS=ON -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03=ON ./
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/gcc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04]
os: [ubuntu-20.04, ubuntu-22.04]

steps:
- uses: actions/checkout@v2
Expand All @@ -32,7 +32,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04]
os: [ubuntu-20.04, ubuntu-22.04]

steps:
- uses: actions/checkout@v2
Expand All @@ -53,7 +53,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04]
os: [ubuntu-20.04, ubuntu-22.04]

steps:
- uses: actions/checkout@v2
Expand Down
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/helpers.cmake)
set(MSG_PREFIX "etl |")
determine_version_with_git(${GIT_DIR_LOOKUP_POLICY})
if(NOT ETL_VERSION)
determine_version("version.txt")
determine_version_with_file("version.txt")
endif()

project(etl VERSION ${ETL_VERSION} LANGUAGES CXX)
Expand Down Expand Up @@ -73,9 +73,9 @@ if(${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME})
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake)
install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/etl DESTINATION include)
endif()

if (BUILD_TESTS)
enable_testing()
add_subdirectory(test)
if (BUILD_TESTS)
enable_testing()
add_subdirectory(test)
endif()
endif()
2 changes: 1 addition & 1 deletion arduino/library-arduino.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Embedded Template Library - Arduino",
"version": "20.35.0",
"version": "20.35.10",
"authors": {
"name": "John Wellbelove",
"email": "john.wellbelove@etlcpp.com"
Expand Down
2 changes: 1 addition & 1 deletion arduino/library-arduino.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Embedded Template Library - Arduino
version=20.35.0
version=20.35.10
author= John Wellbelove <john.wellbelove@etlcpp.com>
maintainer=John Wellbelove <john.wellbelove@etlcpp.com>
license=MIT
Expand Down
8 changes: 6 additions & 2 deletions cmake/helpers.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function(determine_version VER_FILE_NAME)
function(determine_version_with_file VER_FILE_NAME)
file(READ ${VER_FILE_NAME} ETL_VERSION_RAW)
# Remove trailing whitespaces and/or newline
string(STRIP ${ETL_VERSION_RAW} ETL_VERSION)
Expand All @@ -13,7 +13,11 @@ function(determine_version_with_git)
git_describe(VERSION ${ARGN})
string(FIND ${VERSION} "." VALID_VERSION)
if(VALID_VERSION EQUAL -1)
message(WARNING "Version string ${VERSION} retrieved with git describe is invalid")
if(PROJECT_IS_TOP_LEVEL)
# only warn if this is the top-level project, since we may be
# building from a tarball as a subproject
message(WARNING "Version string ${VERSION} retrieved with git describe is invalid")
endif()
return()
endif()
message(STATUS "${MSG_PREFIX} Version string determined with git describe: ${VERSION}")
Expand Down
9 changes: 4 additions & 5 deletions include/etl/array_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ SOFTWARE.
#include "nullptr.h"
#include "hash.h"
#include "algorithm.h"
#include "memory.h"
#include "type_traits.h"

#if ETL_USING_STL && ETL_USING_CPP11
Expand Down Expand Up @@ -155,7 +154,7 @@ namespace etl
/// Construct from etl::array.
//*************************************************************************
template <typename U, size_t N>
ETL_CONSTEXPR array_view(etl::array<U, N>& a, typename etl::enable_if<etl::is_same<typename etl::remove_cv<T>::type, typename etl::remove_cv<U>::type>::value, void>::type) ETL_NOEXCEPT
ETL_CONSTEXPR array_view(etl::array<U, N>& a, typename etl::enable_if<etl::is_same<typename etl::remove_cv<T>::type, typename etl::remove_cv<U>::type>::value, void>::type* = 0) ETL_NOEXCEPT
: mbegin(a.data())
, mend(a.data() + a.size())
{
Expand All @@ -165,7 +164,7 @@ namespace etl
/// Construct from etl::array.
//*************************************************************************
template <typename U, size_t N>
ETL_CONSTEXPR array_view(const etl::array<U, N>& a, typename etl::enable_if<etl::is_same<typename etl::remove_cv<T>::type, typename etl::remove_cv<U>::type>::value, void>::type) ETL_NOEXCEPT
ETL_CONSTEXPR array_view(const etl::array<U, N>& a, typename etl::enable_if<etl::is_same<typename etl::remove_cv<T>::type, typename etl::remove_cv<U>::type>::value, void>::type* = 0) ETL_NOEXCEPT
: mbegin(a.data())
, mend(a.data() + a.size())
{
Expand Down Expand Up @@ -215,7 +214,7 @@ namespace etl
template <typename TContainer>
ETL_CONSTEXPR array_view(TContainer& a, typename etl::enable_if<!etl::is_pointer<typename etl::remove_reference<TContainer>::type>::value &&
!etl::is_array<TContainer>::value &&
etl::is_same<typename etl::remove_cv<T>::type, typename etl::remove_cv<typename etl::remove_reference<TContainer>::type::value_type>::type>::value, void>::type) ETL_NOEXCEPT
etl::is_same<typename etl::remove_cv<T>::type, typename etl::remove_cv<typename etl::remove_reference<TContainer>::type::value_type>::type>::value, void>::type* = 0) ETL_NOEXCEPT
: mbegin(a.data())
, mend(a.data() + a.size())
{
Expand All @@ -228,7 +227,7 @@ namespace etl
template <typename TContainer>
ETL_CONSTEXPR array_view(const TContainer& a, typename etl::enable_if<!etl::is_pointer<typename etl::remove_reference<TContainer>::type>::value &&
!etl::is_array<TContainer>::value &&
etl::is_same<typename etl::remove_cv<T>::type, typename etl::remove_cv<typename etl::remove_reference<TContainer>::type::value_type>::type>::value, void>::type) ETL_NOEXCEPT
etl::is_same<typename etl::remove_cv<T>::type, typename etl::remove_cv<typename etl::remove_reference<TContainer>::type::value_type>::type>::value, void>::type* = 0) ETL_NOEXCEPT
: mbegin(a.data())
, mend(a.data() + a.size())
{
Expand Down
4 changes: 2 additions & 2 deletions include/etl/binary.h
Original file line number Diff line number Diff line change
Expand Up @@ -2198,7 +2198,7 @@ namespace etl

return (nbits == etl::integral_limits<type>::bits) ? static_cast<T>(etl::integral_limits<type>::max)
: static_cast<T>((static_cast<type>(1U) << nbits) - 1U);
};
}

//***********************************
template <typename T, size_t NBits>
Expand All @@ -2214,7 +2214,7 @@ namespace etl
ETL_CONSTEXPR T make_msb_mask(size_t nbits)
{
return static_cast<T>(etl::reverse_bits(make_lsb_mask<T>(nbits)));
};
}

//***************************************************************************
/// 8 bit binary byte constants.
Expand Down
2 changes: 1 addition & 1 deletion include/etl/delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ SOFTWARE.

#include "platform.h"

#if ETL_USING_CPP11 && !defined(ETL_CRC_FORCE_CPP03_IMPLEMENTATION)
#if ETL_USING_CPP11 && !defined(ETL_DELEGATE_FORCE_CPP03_IMPLEMENTATION)
#include "private/delegate_cpp11.h"
#else
#include "private/delegate_cpp03.h"
Expand Down
Loading

0 comments on commit 5fb3e4c

Please sign in to comment.