Skip to content

Commit

Permalink
Update for C++20 (#18)
Browse files Browse the repository at this point in the history
* update: copyright comments

* update: hunter

* update: bump C++ standard up to C++20

* refactor: gsl::span replaced by std::span
* refactor: containers replaced by range (where it possible)
* refactor: clang-format

* refactor: replace include-guards by pragma-once

* feature: concepts for static and dynamic collections

* feature: concepts for static and dynamic span

* update: bump version to 1.1.0

* fix: review issues

Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>

* fix: CI issues

Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>

* fix: remove remaining mentions of GSL

Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>

* remove unused buffer

* remove unused hex

* remove concept

* fix: remove redundant data structures

Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>

* update: .gitignore

Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>

* update: .gitignore

Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>

* refactor: prohibit potentially dangerous implementation

Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>

* refactor: return implementation for vector<bool>

Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>

---------

Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>
Co-authored-by: turuslan <[email protected]>
  • Loading branch information
xDimon and turuslan authored Oct 26, 2023
1 parent b2af924 commit 46e2695
Show file tree
Hide file tree
Showing 50 changed files with 658 additions and 1,449 deletions.
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
build
.vscode
.idea
cmake-build-*/
**/build/
**/build-*/
**/cmake-build-*/
Testing
16 changes: 7 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#
# Copyright Soramitsu Co., Ltd. All Rights Reserved.
# Copyright Quadrivium LLC
# All Rights Reserved
# SPDX-License-Identifier: Apache-2.0
#

Expand All @@ -8,13 +9,13 @@ cmake_minimum_required(VERSION 3.12)
include(${CMAKE_CURRENT_LIST_DIR}/cmake/HunterGate.cmake)

HunterGate(
URL "https://github.com/soramitsu/soramitsu-hunter/archive/v0.23.257-soramitsu42.tar.gz"
SHA1 "6f54ad82c2322ff0e234ab96a44a12da1478f1be"
URL https://github.com/qdrvm/hunter/archive/refs/tags/v0.23.257-qdrvm10.tar.gz
SHA1 72b446a4424ba28ea90f9a68a9134b0f8e44b5b2
)

project(Scale LANGUAGES CXX VERSION 1.0.0)
project(Scale LANGUAGES CXX VERSION 1.1.0)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

Expand All @@ -25,9 +26,6 @@ option(BUILD_TESTS "Whether to include the test suite in build" OFF)
hunter_add_package(Boost)
find_package(Boost CONFIG REQUIRED)

hunter_add_package(Microsoft.GSL)
find_package(Microsoft.GSL CONFIG REQUIRED)

add_subdirectory(src)

if (BUILD_TESTS)
Expand All @@ -41,7 +39,7 @@ endif ()

include(GNUInstallDirs)

install(TARGETS scale buffer scale_encode_append EXPORT scaleConfig
install(TARGETS scale scale_encode_append EXPORT scaleConfig
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ template<class T>
outcome::result<std::vector<uint8_t>> encode(T &&t);

template <class T>
outcome::result<T> decode(gsl::span<const uint8_t> span)
outcome::result<T> decode(const RangeOfBytes auto& span)

template <class T>
outcome::result<T> decode(ScaleDecoderStream &s)
Expand Down
8 changes: 3 additions & 5 deletions include/scale/bitvec.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* Copyright Soramitsu Co., Ltd. All Rights Reserved.
* Copyright Quadrivium LLC
* All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*/

#ifndef SCALE_BITVEC_HPP
#define SCALE_BITVEC_HPP
#pragma once

#include <vector>

Expand All @@ -23,5 +23,3 @@ namespace scale {
}
};
} // namespace scale

#endif // SCALE_BITVEC_HPP
284 changes: 0 additions & 284 deletions include/scale/buffer/buffer.hpp

This file was deleted.

Loading

0 comments on commit 46e2695

Please sign in to comment.