Bläddra i källkod

Merge branch 'feature/subrepo-deps' into develop

default_compile_flags
vector-of-bool 5 år sedan
förälder
incheckning
7ebb544c9a
100 ändrade filer med 578 tillägg och 21 borttagningar
  1. +3
    -1
      .gitignore
  2. +6
    -15
      azure-pipelines.yml
  3. +1
    -1
      external/args.lml
  4. +1
    -1
      external/ms-third.lmp
  5. +1
    -1
      external/nlohmann-json.lml
  6. +2
    -2
      external/ranges-v3.lml
  7. +2
    -0
      external/repo/neo-buffer/.gitignore
  8. +12
    -0
      external/repo/neo-buffer/.gitrepo
  9. +1
    -0
      external/repo/neo-buffer/library.dds
  10. +3
    -0
      external/repo/neo-buffer/package.dds
  11. +61
    -0
      external/repo/neo-buffer/src/neo/base_buffer.hpp
  12. +1
    -0
      external/repo/neo-buffer/src/neo/buffer.cpp
  13. +109
    -0
      external/repo/neo-buffer/src/neo/buffer.hpp
  14. +38
    -0
      external/repo/neo-buffer/src/neo/buffer.test.cpp
  15. +11
    -0
      external/repo/neo-buffer/src/neo/buffer.test.hpp
  16. +71
    -0
      external/repo/neo-buffer/src/neo/buffer_algorithm.hpp
  17. +18
    -0
      external/repo/neo-buffer/src/neo/buffer_algorithm.test.cpp
  18. +46
    -0
      external/repo/neo-buffer/src/neo/buffer_concepts.hpp
  19. +47
    -0
      external/repo/neo-buffer/src/neo/buffer_seq_iter.hpp
  20. +64
    -0
      external/repo/neo-buffer/src/neo/const_buffer.hpp
  21. +17
    -0
      external/repo/neo-buffer/src/neo/const_buffer.test.cpp
  22. +52
    -0
      external/repo/neo-buffer/src/neo/mutable_buffer.hpp
  23. +3
    -0
      external/repo/neo-buffer/src/neo/mutable_buffer.test.cpp
  24. +4
    -0
      external/repo/neo-buffer/toolchain.dds
  25. +0
    -0
      external/repo/nlohmann-json/include/nlohmann/json.hpp
  26. +1
    -0
      external/repo/nlohmann-json/library.dds
  27. +3
    -0
      external/repo/nlohmann-json/package.dds
  28. +0
    -0
      external/repo/range-v3/include/concepts/concepts.hpp
  29. +0
    -0
      external/repo/range-v3/include/concepts/swap.hpp
  30. +0
    -0
      external/repo/range-v3/include/concepts/type_traits.hpp
  31. +0
    -0
      external/repo/range-v3/include/meta/meta.hpp
  32. +0
    -0
      external/repo/range-v3/include/meta/meta_fwd.hpp
  33. +0
    -0
      external/repo/range-v3/include/module.modulemap
  34. +0
    -0
      external/repo/range-v3/include/range/v3/action.hpp
  35. +0
    -0
      external/repo/range-v3/include/range/v3/action/action.hpp
  36. +0
    -0
      external/repo/range-v3/include/range/v3/action/adjacent_remove_if.hpp
  37. +0
    -0
      external/repo/range-v3/include/range/v3/action/concepts.hpp
  38. +0
    -0
      external/repo/range-v3/include/range/v3/action/drop.hpp
  39. +0
    -0
      external/repo/range-v3/include/range/v3/action/drop_while.hpp
  40. +0
    -0
      external/repo/range-v3/include/range/v3/action/erase.hpp
  41. +0
    -0
      external/repo/range-v3/include/range/v3/action/insert.hpp
  42. +0
    -0
      external/repo/range-v3/include/range/v3/action/join.hpp
  43. +0
    -0
      external/repo/range-v3/include/range/v3/action/push_back.hpp
  44. +0
    -0
      external/repo/range-v3/include/range/v3/action/push_front.hpp
  45. +0
    -0
      external/repo/range-v3/include/range/v3/action/remove.hpp
  46. +0
    -0
      external/repo/range-v3/include/range/v3/action/remove_if.hpp
  47. +0
    -0
      external/repo/range-v3/include/range/v3/action/reverse.hpp
  48. +0
    -0
      external/repo/range-v3/include/range/v3/action/shuffle.hpp
  49. +0
    -0
      external/repo/range-v3/include/range/v3/action/slice.hpp
  50. +0
    -0
      external/repo/range-v3/include/range/v3/action/sort.hpp
  51. +0
    -0
      external/repo/range-v3/include/range/v3/action/split.hpp
  52. +0
    -0
      external/repo/range-v3/include/range/v3/action/split_when.hpp
  53. +0
    -0
      external/repo/range-v3/include/range/v3/action/stable_sort.hpp
  54. +0
    -0
      external/repo/range-v3/include/range/v3/action/stride.hpp
  55. +0
    -0
      external/repo/range-v3/include/range/v3/action/take.hpp
  56. +0
    -0
      external/repo/range-v3/include/range/v3/action/take_while.hpp
  57. +0
    -0
      external/repo/range-v3/include/range/v3/action/transform.hpp
  58. +0
    -0
      external/repo/range-v3/include/range/v3/action/unique.hpp
  59. +0
    -0
      external/repo/range-v3/include/range/v3/action/unstable_remove_if.hpp
  60. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm.hpp
  61. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm/adjacent_find.hpp
  62. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm/adjacent_remove_if.hpp
  63. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm/all_of.hpp
  64. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm/any_of.hpp
  65. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm/aux_/equal_range_n.hpp
  66. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm/aux_/lower_bound_n.hpp
  67. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm/aux_/merge_n.hpp
  68. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm/aux_/merge_n_with_buffer.hpp
  69. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm/aux_/partition_point_n.hpp
  70. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm/aux_/sort_n_with_buffer.hpp
  71. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm/aux_/upper_bound_n.hpp
  72. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm/binary_search.hpp
  73. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm/copy.hpp
  74. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm/copy_backward.hpp
  75. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm/copy_if.hpp
  76. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm/copy_n.hpp
  77. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm/count.hpp
  78. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm/count_if.hpp
  79. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm/ends_with.hpp
  80. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm/equal.hpp
  81. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm/equal_range.hpp
  82. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm/fill.hpp
  83. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm/fill_n.hpp
  84. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm/find.hpp
  85. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm/find_end.hpp
  86. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm/find_first_of.hpp
  87. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm/find_if.hpp
  88. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm/find_if_not.hpp
  89. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm/for_each.hpp
  90. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm/for_each_n.hpp
  91. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm/generate.hpp
  92. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm/generate_n.hpp
  93. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm/heap_algorithm.hpp
  94. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm/inplace_merge.hpp
  95. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm/is_partitioned.hpp
  96. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm/is_sorted.hpp
  97. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm/is_sorted_until.hpp
  98. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm/lexicographical_compare.hpp
  99. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm/lower_bound.hpp
  100. +0
    -0
      external/repo/range-v3/include/range/v3/algorithm/max.hpp

+ 3
- 1
.gitignore Visa fil

@@ -3,4 +3,6 @@ __pycache__/
.peru/
.vscode/
.mypy_cache/
*.dsd/
*.dsd/
_prebuilt/
.dds-repo-lock

+ 6
- 15
azure-pipelines.yml Visa fil

@@ -9,16 +9,11 @@ jobs:
- script: |
echo Loading VS environment
call "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\Tools\\vsdevcmd" -arch=x64 || exit 1
echo Executing build/test script
python -u tools/build.py --cxx cl.exe --test --static || exit 1
displayName: Build and Run Unit Tests
echo Executing Build and Tests
python -u tools/ci.py --cxx cl.exe -T tools\\msvc.dds || exit 1
displayName: Full CI
- publish: _build/dds.exe
artifact: DDS Executable - Windows VS2019
- script: |
echo Loading VS environment
call "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\Tools\\vsdevcmd" -arch=x64 || exit 1
python -u tools/test.py --exe _build/dds.exe -T tools/msvc.dds || exit 1
displayName: Smoke Tests

- job: Linux_GCC8
pool:
@@ -26,12 +21,10 @@ jobs:
steps:
- script: sudo apt update -y && sudo apt install -y python3-minimal g++-8
displayName: Prepare System
- script: python3 -u tools/build.py --cxx g++-8 --test --static
displayName: Build and Run Unit Tests
- script: python3 -u tools/ci.py --cxx g++-8 -T tools/gcc-8.dds
displayName: Full CI
- publish: _build/dds
artifact: DDS Executable - Linux
- script: python3 -u tools/test.py --exe _build/dds -T:gcc-8
displayName: Smoke Tests

- job: macOS_GCC8
pool:
@@ -39,9 +32,7 @@ jobs:
steps:
- script: brew install gcc@8
displayName: Prepare System
- script: python3 -u tools/build.py --cxx g++-8 --test
- script: python3 -u tools/ci.py --cxx g++-8 -T tools/gcc-8.dds
displayName: Build and Run Unit Tests
- publish: _build/dds
artifact: DDS Executable - macOS
- script: python3 -u tools/test.py --exe _build/dds -T:gcc-8
displayName: Smoke Tests

+ 1
- 1
external/args.lml Visa fil

@@ -2,4 +2,4 @@ Type: Library

Name: args

Include-Path: taywee-args/include
Include-Path: repo/taywee-args/include

+ 1
- 1
external/ms-third.lmp Visa fil

@@ -1,6 +1,6 @@
Type: Package

Name: ms-third
Namespace: ms
Namespace: Microsoft

Library: wil.lml

+ 1
- 1
external/nlohmann-json.lml Visa fil

@@ -1,4 +1,4 @@
Type: Library
Name: json

Include-Path: nlohmann-json/include
Include-Path: repo/nlohmann-json/include

+ 2
- 2
external/ranges-v3.lml Visa fil

@@ -1,4 +1,4 @@
Type: Library

Name: ranges-v3
Include-Path: ranges-v3/include
Name: range-v3
Include-Path: repo/range-v3/include

+ 2
- 0
external/repo/neo-buffer/.gitignore Visa fil

@@ -0,0 +1,2 @@
_build/
.vscode/

+ 12
- 0
external/repo/neo-buffer/.gitrepo Visa fil

@@ -0,0 +1,12 @@
; DO NOT EDIT (unless you know what you are doing)
;
; This subdirectory is a git "subrepo", and this file is maintained by the
; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme
;
[subrepo]
remote = git@github.com:vector-of-bool/neo-buffer.git
branch = develop
commit = 9461eded7f661b31bcdf4f8760ebe4ebc83e9630
parent = 4bc28954ef34869a5b5ad65094c6f56a23937f8b
method = merge
cmdver = 0.4.0

+ 1
- 0
external/repo/neo-buffer/library.dds Visa fil

@@ -0,0 +1 @@
Name: buffer

+ 3
- 0
external/repo/neo-buffer/package.dds Visa fil

@@ -0,0 +1,3 @@
Name: neo-buffer
Namespace: neo
Version: 0.1.0

+ 61
- 0
external/repo/neo-buffer/src/neo/base_buffer.hpp Visa fil

@@ -0,0 +1,61 @@
#pragma once

#include <cstddef>
#include <iterator>

namespace neo {

namespace detail {

class single_buffer_iter_sentinel {};

template <typename Buffer>
class single_buffer_iter {
Buffer _buf;
bool _dead = false;

public:
using difference_type = std::ptrdiff_t;
using value_type = Buffer;
using pointer = const value_type*;
using reference = const value_type&;
using iterator_category = std::forward_iterator_tag;

constexpr single_buffer_iter(Buffer b) noexcept
: _buf(b) {}

constexpr reference operator*() const noexcept { return _buf; }
constexpr pointer operator->() const noexcept { return &_buf; }

constexpr bool operator==(single_buffer_iter_sentinel) const noexcept { return _dead; }
constexpr bool operator!=(single_buffer_iter_sentinel) const noexcept { return !_dead; }
constexpr bool operator==(single_buffer_iter o) const noexcept { return _dead == o._dead; }
constexpr bool operator!=(single_buffer_iter o) const noexcept { return !(*this == o); }

constexpr single_buffer_iter operator++(int) noexcept {
auto me = *this;
_dead = true;
return me;
}

constexpr single_buffer_iter& operator++() noexcept {
_dead = true;
return *this;
}
};

} // namespace detail

template <typename T>
constexpr std::byte* byte_pointer(T* ptr) noexcept requires std::is_trivial_v<T> {
auto void_ = static_cast<void*>(ptr);
return static_cast<std::byte*>(void_);
}

template <typename T>
constexpr const std::byte* byte_pointer(const T* ptr) noexcept requires std::is_trivial_v<T> {
auto void_ = static_cast<const void*>(ptr);
return static_cast<const std::byte*>(void_);
}

} // namespace neo

+ 1
- 0
external/repo/neo-buffer/src/neo/buffer.cpp Visa fil

@@ -0,0 +1 @@
#include "./buffer.hpp"

+ 109
- 0
external/repo/neo-buffer/src/neo/buffer.hpp Visa fil

@@ -0,0 +1,109 @@
#pragma once

#include <neo/const_buffer.hpp>
#include <neo/mutable_buffer.hpp>

#include <string>
#include <string_view>
#include <type_traits>

namespace neo {

constexpr mutable_buffer buffer(const mutable_buffer& b) noexcept { return b; }
constexpr mutable_buffer buffer(const mutable_buffer& b, mutable_buffer::size_type s) noexcept {
auto min_size = s > b.size() ? b.size() : s;
return mutable_buffer(b.data(), min_size);
}

constexpr const_buffer buffer(const const_buffer& b) noexcept { return b; }
constexpr const_buffer buffer(const const_buffer& b, const_buffer::size_type s) noexcept {
auto min_size = s > b.size() ? b.size() : s;
return const_buffer(b.data(), min_size);
}

// #############################################################################
/**
* Create a mutable buffer from an opaque pointer to void
*/
constexpr mutable_buffer buffer(void* ptr, mutable_buffer::size_type s) noexcept {
return mutable_buffer(static_cast<std::byte*>(ptr), s);
}

/**
* Create an immutable buffer from an opaque pointer to void
*/
constexpr const_buffer buffer(const void* ptr, const_buffer::size_type s) noexcept {
return const_buffer(static_cast<const std::byte*>(ptr), s);
}

// #############################################################################
/**
* Create a mutable buffer that refers to the bytes of a trivial object.
*/
template <typename Trivial,
typename
= std::enable_if_t<!std::is_const_v<Trivial> && !std::is_same_v<Trivial, mutable_buffer>>>
constexpr mutable_buffer buffer(Trivial& item, std::size_t max_size = sizeof(Trivial)) {
auto min_size = max_size > sizeof(item) ? sizeof(item) : max_size;
return mutable_buffer(byte_pointer(std::addressof(item)), min_size);
}

/**
* Create an immutable buffer that refers to the bytes of a trivial object.
*/
template <
typename Trivial,
typename = std::enable_if_t<
std::is_const_v<
Trivial> && !std::is_same_v<Trivial, mutable_buffer> && !std::is_same_v<Trivial, const_buffer>>>
constexpr const_buffer buffer(Trivial& item, std::size_t max_size = sizeof(Trivial)) {
auto min_size = std::min(sizeof(item), max_size);
return const_buffer(byte_pointer(std::addressof(item)), min_size);
}

// #############################################################################
/**
* Create a mutable buffer referring to the characters of a basic_string object
*/
template <typename Char, typename Traits, typename Alloc>
constexpr mutable_buffer buffer(std::basic_string<Char, Traits, Alloc>& str, std::size_t max_size) {
auto use_size = max_size > str.size() ? str.size() : max_size;
return buffer(str.data(), use_size);
}

template <typename Char, typename Traits, typename Alloc>
constexpr mutable_buffer buffer(std::basic_string<Char, Traits, Alloc>& str) {
return buffer(str, str.size());
}

/**
* Create an immutable buffer refering to the characters of a basic_string object
*/
template <typename Char, typename Traits, typename Alloc>
constexpr const_buffer buffer(const std::basic_string<Char, Traits, Alloc>& str,
std::size_t max_size) {
auto use_size = max_size > str.size() ? str.size() : max_size;
return buffer(str.data(), use_size);
}

template <typename Char, typename Traits, typename Alloc>
constexpr const_buffer buffer(const std::basic_string<Char, Traits, Alloc>& str) {
return buffer(str, str.size());
}

// #############################################################################
/**
* Create an immutable buffer referring to the characters of a basic_string_view
*/
template <typename Char, typename Traits>
constexpr const_buffer buffer(std::basic_string_view<Char, Traits> sv, std::size_t max_size) {
auto use_size = max_size > sv.size() ? sv.size() : max_size;
return buffer(sv.data(), use_size);
}

template <typename Char, typename Traits>
constexpr const_buffer buffer(std::basic_string_view<Char, Traits> sv) {
return buffer(sv, sv.size());
}

} // namespace neo

+ 38
- 0
external/repo/neo-buffer/src/neo/buffer.test.cpp Visa fil

@@ -0,0 +1,38 @@
#include <neo/buffer.hpp>

#include <neo/buffer.test.hpp>
#include <neo/buffer_algorithm.hpp>

#include <array>
#include <string>

struct my_simple_struct {
int a;
int b;
};

int main() {
// std::string s = "I am a string!";
// auto s_buf = neo::buffer(s);
// CHECK(s_buf.data() == s.data());

my_simple_struct foo;
foo.a = 12;
foo.b = 3;

neo::mutable_buffer pod_buf = neo::buffer(foo);
CHECK(pod_buf.size() == sizeof(foo));

my_simple_struct bar;
neo::buffer_copy(neo::buffer(bar), pod_buf);
CHECK(bar.a == foo.a);
CHECK(bar.b == foo.b);

bar.b = 55;

std::array<char, sizeof bar> buf;
neo::buffer_copy(neo::buffer(buf), neo::buffer(bar));

neo::buffer_copy(neo::buffer(foo), neo::buffer(buf));
CHECK(foo.b == 55);
}

+ 11
- 0
external/repo/neo-buffer/src/neo/buffer.test.hpp Visa fil

@@ -0,0 +1,11 @@
#pragma once

#include <iostream>

#define CHECK(...) \
do { \
if (!(__VA_ARGS__)) { \
std::cerr << "Check failed: " << (#__VA_ARGS__) << '\n'; \
return 1; \
} \
} while (0)

+ 71
- 0
external/repo/neo-buffer/src/neo/buffer_algorithm.hpp Visa fil

@@ -0,0 +1,71 @@
#pragma once

#include <neo/buffer_concepts.hpp>
#include <neo/const_buffer.hpp>
#include <neo/mutable_buffer.hpp>

#include <algorithm>
#include <cstddef>
#include <cstring>

namespace neo {

template <typename Seq>
constexpr std::size_t buffer_size(const Seq& seq) {
auto iter = buffer_sequence_begin(seq);
const auto stop = buffer_sequence_end(seq);
std::size_t size = 0;
while (iter != stop) {
size += static_cast<std::size_t>(iter->size());
++iter;
}
return size;
}

template <mutable_buffer_sequence MutableSeq, const_buffer_sequence ConstSeq>
constexpr std::size_t
buffer_copy(const MutableSeq& dest, const ConstSeq& src, std::size_t max_copy) {
auto remaining_to_copy = max_copy;
std::size_t n_copied = 0;
auto dest_iter = buffer_sequence_begin(dest);
const auto dest_stop = buffer_sequence_end(dest);
auto src_iter = buffer_sequence_begin(src);
const auto src_stop = buffer_sequence_end(dest);

std::size_t src_offset = 0;
std::size_t dest_offset = 0;

while (dest_iter != dest_stop && src_iter != src_stop && remaining_to_copy) {
const_buffer src_buf = *src_iter + src_offset;
mutable_buffer dest_buf = *dest_iter + dest_offset;

const auto copy_now
= std::min(src_buf.size(), std::min(dest_buf.size(), remaining_to_copy));
std::memcpy(dest_buf.data(), src_buf.data(), copy_now);
n_copied += copy_now;
src_buf += n_copied;
dest_buf += n_copied;
src_offset += n_copied;
dest_offset += n_copied;
if (src_buf.size() == 0) {
++src_iter;
src_offset = 0;
}
if (dest_buf.size() == 0) {
++dest_iter;
dest_offset = 0;
}
}

return 0;
}

template <typename MutableSeq, typename ConstSeq>
constexpr std::size_t buffer_copy(const MutableSeq& dest, const ConstSeq& src) {
auto src_size = buffer_size(src);
auto dest_size = buffer_size(dest);
auto min_size = (src_size > dest_size) ? dest_size : src_size;
return buffer_copy(dest, src, min_size);
}

} // namespace neo

+ 18
- 0
external/repo/neo-buffer/src/neo/buffer_algorithm.test.cpp Visa fil

@@ -0,0 +1,18 @@
#include <neo/buffer_algorithm.hpp>

#include <neo/buffer.test.hpp>

#include <neo/const_buffer.hpp>

#include <string_view>

int main() {
auto buf = neo::const_buffer("A string");
auto buf_iter = neo::buffer_sequence_begin(buf);
CHECK(buf_iter->data() == buf.data());
CHECK(buf_iter != neo::buffer_sequence_end(buf));

CHECK(neo::buffer_size(buf) == buf.size());

// neo::buffer_size(12);
}

+ 46
- 0
external/repo/neo-buffer/src/neo/buffer_concepts.hpp Visa fil

@@ -0,0 +1,46 @@
#pragma once

#ifndef NEO_CONCEPT
#if defined(__GNUC__) && __GNUC__ < 9
#define NEO_CONCEPT concept bool
#else
#define NEO_CONCEPT concept
#endif
#endif

#include <neo/buffer_seq_iter.hpp>
#include <neo/const_buffer.hpp>
#include <neo/mutable_buffer.hpp>

#include <iterator>

namespace neo {

template <typename T>
NEO_CONCEPT const_buffer_sequence_iterator = requires(T iter) {
typename std::iterator_traits<T>::value_type;
std::is_convertible_v<typename std::iterator_traits<T>::value_type, const_buffer>;
};

template <typename T>
NEO_CONCEPT mutable_buffer_sequence_iterator
= const_buffer_sequence_iterator<T>&& requires(T iter) {
std::is_convertible_v<typename std::iterator_traits<T>::value_type, mutable_buffer>;
};

template <typename T>
NEO_CONCEPT const_buffer_sequence = requires(T seq) {
{ buffer_sequence_begin(seq) }
->const_buffer_sequence_iterator;
buffer_sequence_end(seq);
{ buffer_sequence_begin(seq) != buffer_sequence_end(seq) }
->bool;
};

template <typename T>
NEO_CONCEPT mutable_buffer_sequence = const_buffer_sequence<T>&& requires(T seq) {
{ buffer_sequence_begin(seq) }
->mutable_buffer_sequence_iterator;
};

} // namespace neo

+ 47
- 0
external/repo/neo-buffer/src/neo/buffer_seq_iter.hpp Visa fil

@@ -0,0 +1,47 @@
#pragma once

#include <utility>

namespace neo {

constexpr inline struct buffer_sequence_begin_fn {
template <typename T>
decltype(auto) operator()(T&& t) const requires requires {
buffer_sequence_begin(t);
}
{ return buffer_sequence_begin(t); }

template <typename T>
decltype(auto) operator()(T&& t) const requires requires {
t.buffer_sequence_begin();
}
{ return t.buffer_sequence_begin(); }

template <typename T>
decltype(auto) operator()(T&& t) const requires requires {
_impl_buffer_sequence_begin(t);
}
{ return _impl_buffer_sequence_begin(t); }
} buffer_sequence_begin;

inline struct buffer_sequence_end_fn {
template <typename T>
decltype(auto) operator()(T&& t) const requires requires {
buffer_sequence_end(t);
}
{ return buffer_sequence_end(t); }

template <typename T>
decltype(auto) operator()(T&& t) const requires requires {
t.buffer_sequence_end();
}
{ return t.buffer_sequence_end(); }

template <typename T>
decltype(auto) operator()(T&& t) const requires requires {
_impl_buffer_sequence_end(t);
}
{ return _impl_buffer_sequence_end(t); }
} buffer_sequence_end;

} // namespace neo

+ 64
- 0
external/repo/neo-buffer/src/neo/const_buffer.hpp Visa fil

@@ -0,0 +1,64 @@
#pragma once

#include <neo/base_buffer.hpp>
#include <neo/mutable_buffer.hpp>

#include <cassert>
#include <cstddef>
#include <string_view>

namespace neo {

/**
* A type that represents a view to a readonly segment of contiguous memory.
*/
class const_buffer {
public:
using pointer = const std::byte*;
using size_type = std::size_t;

private:
pointer _data = nullptr;
size_type _size = 0;

public:
constexpr const_buffer() noexcept = default;
constexpr const_buffer(pointer ptr, size_type size) noexcept
: _data(ptr)
, _size(size) {}

constexpr const_buffer(mutable_buffer buf)
: _data(buf.data())
, _size(buf.size()) {}

explicit constexpr const_buffer(std::string_view sv)
: _data(byte_pointer(sv.data()))
, _size(sv.size()) {}

constexpr pointer data() const noexcept { return _data; }
constexpr pointer data_end() const noexcept { return _data + size(); }
constexpr size_type size() const noexcept { return _size; }

constexpr const_buffer& operator+=(size_type s) noexcept {
assert(s <= size() && "Advanced neo::const_buffer past-the-end");
_data += s;
_size -= s;
return *this;
}
};

inline constexpr const_buffer operator+(const_buffer buf, const_buffer::size_type s) noexcept {
auto copy = buf;
copy += s;
return copy;
}

inline constexpr auto _impl_buffer_sequence_begin(const_buffer buf) noexcept {
return detail::single_buffer_iter(buf);
}

inline constexpr auto _impl_buffer_sequence_end(const_buffer) noexcept {
return detail::single_buffer_iter_sentinel();
}

} // namespace neo

+ 17
- 0
external/repo/neo-buffer/src/neo/const_buffer.test.cpp Visa fil

@@ -0,0 +1,17 @@
#include <neo/buffer.test.hpp>
#include <neo/const_buffer.hpp>

#include <iostream>

int main() {
neo::const_buffer buf;
CHECK(buf.size() == 0);

buf = neo::const_buffer("meow");
CHECK(buf.size() == 4);
auto buf2 = buf + 3;
CHECK(buf2.size() == 1);
CHECK(buf2.data()[0] == std::byte('w'));
buf2 += 1;
CHECK(buf2.size() == 0);
}

+ 52
- 0
external/repo/neo-buffer/src/neo/mutable_buffer.hpp Visa fil

@@ -0,0 +1,52 @@
#pragma once

#include <neo/base_buffer.hpp>

#include <cstddef>
#include <iterator>
#include <type_traits>

namespace neo {

class mutable_buffer {
public:
using pointer = std::byte*;
using size_type = std::size_t;

private:
pointer _data = nullptr;
size_type _size = 0;

public:
constexpr mutable_buffer() noexcept = default;
constexpr mutable_buffer(pointer p, size_type size) noexcept
: _data(p)
, _size(size) {}

constexpr mutable_buffer& operator+=(size_type s) noexcept {
_data += s;
_size -= s;
return *this;
}

constexpr pointer data() const noexcept { return _data; }
constexpr pointer data_end() const noexcept { return _data + size(); }
constexpr size_type size() const noexcept { return _size; }
};

inline constexpr mutable_buffer operator+(mutable_buffer buf,
mutable_buffer::size_type s) noexcept {
auto copy = buf;
copy += s;
return copy;
}

inline constexpr auto _impl_buffer_sequence_begin(mutable_buffer buf) noexcept {
return detail::single_buffer_iter(buf);
}

inline constexpr auto _impl_buffer_sequence_end(mutable_buffer) noexcept {
return detail::single_buffer_iter_sentinel();
}

} // namespace neo

+ 3
- 0
external/repo/neo-buffer/src/neo/mutable_buffer.test.cpp Visa fil

@@ -0,0 +1,3 @@
#include <neo/mutable_buffer.hpp>

int main() {}

+ 4
- 0
external/repo/neo-buffer/toolchain.dds Visa fil

@@ -0,0 +1,4 @@
Compiler-ID: GNU
C++-Compiler: g++-8
C++-Version: C++17
Flags: -fconcepts

external/nlohmann-json/include/nlohmann/json.hpp → external/repo/nlohmann-json/include/nlohmann/json.hpp Visa fil


+ 1
- 0
external/repo/nlohmann-json/library.dds Visa fil

@@ -0,0 +1 @@
Name: json

+ 3
- 0
external/repo/nlohmann-json/package.dds Visa fil

@@ -0,0 +1,3 @@
Name: nlohmann-json
Namespace: nlohmann
Version: 3.7.0

external/ranges-v3/include/concepts/concepts.hpp → external/repo/range-v3/include/concepts/concepts.hpp Visa fil


external/ranges-v3/include/concepts/swap.hpp → external/repo/range-v3/include/concepts/swap.hpp Visa fil


external/ranges-v3/include/concepts/type_traits.hpp → external/repo/range-v3/include/concepts/type_traits.hpp Visa fil


external/ranges-v3/include/meta/meta.hpp → external/repo/range-v3/include/meta/meta.hpp Visa fil


external/ranges-v3/include/meta/meta_fwd.hpp → external/repo/range-v3/include/meta/meta_fwd.hpp Visa fil


external/ranges-v3/include/module.modulemap → external/repo/range-v3/include/module.modulemap Visa fil


external/ranges-v3/include/range/v3/action.hpp → external/repo/range-v3/include/range/v3/action.hpp Visa fil


external/ranges-v3/include/range/v3/action/action.hpp → external/repo/range-v3/include/range/v3/action/action.hpp Visa fil


external/ranges-v3/include/range/v3/action/adjacent_remove_if.hpp → external/repo/range-v3/include/range/v3/action/adjacent_remove_if.hpp Visa fil


external/ranges-v3/include/range/v3/action/concepts.hpp → external/repo/range-v3/include/range/v3/action/concepts.hpp Visa fil


external/ranges-v3/include/range/v3/action/drop.hpp → external/repo/range-v3/include/range/v3/action/drop.hpp Visa fil


external/ranges-v3/include/range/v3/action/drop_while.hpp → external/repo/range-v3/include/range/v3/action/drop_while.hpp Visa fil


external/ranges-v3/include/range/v3/action/erase.hpp → external/repo/range-v3/include/range/v3/action/erase.hpp Visa fil


external/ranges-v3/include/range/v3/action/insert.hpp → external/repo/range-v3/include/range/v3/action/insert.hpp Visa fil


external/ranges-v3/include/range/v3/action/join.hpp → external/repo/range-v3/include/range/v3/action/join.hpp Visa fil


external/ranges-v3/include/range/v3/action/push_back.hpp → external/repo/range-v3/include/range/v3/action/push_back.hpp Visa fil


external/ranges-v3/include/range/v3/action/push_front.hpp → external/repo/range-v3/include/range/v3/action/push_front.hpp Visa fil


external/ranges-v3/include/range/v3/action/remove.hpp → external/repo/range-v3/include/range/v3/action/remove.hpp Visa fil


external/ranges-v3/include/range/v3/action/remove_if.hpp → external/repo/range-v3/include/range/v3/action/remove_if.hpp Visa fil


external/ranges-v3/include/range/v3/action/reverse.hpp → external/repo/range-v3/include/range/v3/action/reverse.hpp Visa fil


external/ranges-v3/include/range/v3/action/shuffle.hpp → external/repo/range-v3/include/range/v3/action/shuffle.hpp Visa fil


external/ranges-v3/include/range/v3/action/slice.hpp → external/repo/range-v3/include/range/v3/action/slice.hpp Visa fil


external/ranges-v3/include/range/v3/action/sort.hpp → external/repo/range-v3/include/range/v3/action/sort.hpp Visa fil


external/ranges-v3/include/range/v3/action/split.hpp → external/repo/range-v3/include/range/v3/action/split.hpp Visa fil


external/ranges-v3/include/range/v3/action/split_when.hpp → external/repo/range-v3/include/range/v3/action/split_when.hpp Visa fil


external/ranges-v3/include/range/v3/action/stable_sort.hpp → external/repo/range-v3/include/range/v3/action/stable_sort.hpp Visa fil


external/ranges-v3/include/range/v3/action/stride.hpp → external/repo/range-v3/include/range/v3/action/stride.hpp Visa fil


external/ranges-v3/include/range/v3/action/take.hpp → external/repo/range-v3/include/range/v3/action/take.hpp Visa fil


external/ranges-v3/include/range/v3/action/take_while.hpp → external/repo/range-v3/include/range/v3/action/take_while.hpp Visa fil


external/ranges-v3/include/range/v3/action/transform.hpp → external/repo/range-v3/include/range/v3/action/transform.hpp Visa fil


external/ranges-v3/include/range/v3/action/unique.hpp → external/repo/range-v3/include/range/v3/action/unique.hpp Visa fil


external/ranges-v3/include/range/v3/action/unstable_remove_if.hpp → external/repo/range-v3/include/range/v3/action/unstable_remove_if.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm.hpp → external/repo/range-v3/include/range/v3/algorithm.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm/adjacent_find.hpp → external/repo/range-v3/include/range/v3/algorithm/adjacent_find.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm/adjacent_remove_if.hpp → external/repo/range-v3/include/range/v3/algorithm/adjacent_remove_if.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm/all_of.hpp → external/repo/range-v3/include/range/v3/algorithm/all_of.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm/any_of.hpp → external/repo/range-v3/include/range/v3/algorithm/any_of.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm/aux_/equal_range_n.hpp → external/repo/range-v3/include/range/v3/algorithm/aux_/equal_range_n.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm/aux_/lower_bound_n.hpp → external/repo/range-v3/include/range/v3/algorithm/aux_/lower_bound_n.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm/aux_/merge_n.hpp → external/repo/range-v3/include/range/v3/algorithm/aux_/merge_n.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm/aux_/merge_n_with_buffer.hpp → external/repo/range-v3/include/range/v3/algorithm/aux_/merge_n_with_buffer.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm/aux_/partition_point_n.hpp → external/repo/range-v3/include/range/v3/algorithm/aux_/partition_point_n.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm/aux_/sort_n_with_buffer.hpp → external/repo/range-v3/include/range/v3/algorithm/aux_/sort_n_with_buffer.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm/aux_/upper_bound_n.hpp → external/repo/range-v3/include/range/v3/algorithm/aux_/upper_bound_n.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm/binary_search.hpp → external/repo/range-v3/include/range/v3/algorithm/binary_search.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm/copy.hpp → external/repo/range-v3/include/range/v3/algorithm/copy.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm/copy_backward.hpp → external/repo/range-v3/include/range/v3/algorithm/copy_backward.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm/copy_if.hpp → external/repo/range-v3/include/range/v3/algorithm/copy_if.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm/copy_n.hpp → external/repo/range-v3/include/range/v3/algorithm/copy_n.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm/count.hpp → external/repo/range-v3/include/range/v3/algorithm/count.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm/count_if.hpp → external/repo/range-v3/include/range/v3/algorithm/count_if.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm/ends_with.hpp → external/repo/range-v3/include/range/v3/algorithm/ends_with.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm/equal.hpp → external/repo/range-v3/include/range/v3/algorithm/equal.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm/equal_range.hpp → external/repo/range-v3/include/range/v3/algorithm/equal_range.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm/fill.hpp → external/repo/range-v3/include/range/v3/algorithm/fill.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm/fill_n.hpp → external/repo/range-v3/include/range/v3/algorithm/fill_n.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm/find.hpp → external/repo/range-v3/include/range/v3/algorithm/find.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm/find_end.hpp → external/repo/range-v3/include/range/v3/algorithm/find_end.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm/find_first_of.hpp → external/repo/range-v3/include/range/v3/algorithm/find_first_of.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm/find_if.hpp → external/repo/range-v3/include/range/v3/algorithm/find_if.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm/find_if_not.hpp → external/repo/range-v3/include/range/v3/algorithm/find_if_not.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm/for_each.hpp → external/repo/range-v3/include/range/v3/algorithm/for_each.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm/for_each_n.hpp → external/repo/range-v3/include/range/v3/algorithm/for_each_n.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm/generate.hpp → external/repo/range-v3/include/range/v3/algorithm/generate.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm/generate_n.hpp → external/repo/range-v3/include/range/v3/algorithm/generate_n.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm/heap_algorithm.hpp → external/repo/range-v3/include/range/v3/algorithm/heap_algorithm.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm/inplace_merge.hpp → external/repo/range-v3/include/range/v3/algorithm/inplace_merge.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm/is_partitioned.hpp → external/repo/range-v3/include/range/v3/algorithm/is_partitioned.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm/is_sorted.hpp → external/repo/range-v3/include/range/v3/algorithm/is_sorted.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm/is_sorted_until.hpp → external/repo/range-v3/include/range/v3/algorithm/is_sorted_until.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm/lexicographical_compare.hpp → external/repo/range-v3/include/range/v3/algorithm/lexicographical_compare.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm/lower_bound.hpp → external/repo/range-v3/include/range/v3/algorithm/lower_bound.hpp Visa fil


external/ranges-v3/include/range/v3/algorithm/max.hpp → external/repo/range-v3/include/range/v3/algorithm/max.hpp Visa fil


Vissa filer visades inte eftersom för många filer har ändrats

Laddar…
Avbryt
Spara