diff --git a/CMakeLists.txt b/CMakeLists.txt old mode 100644 new mode 100755 diff --git a/CMakeSettings.json b/CMakeSettings.json old mode 100644 new mode 100755 diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/build_and_run_debug.sh b/build_and_run_debug.sh old mode 100644 new mode 100755 diff --git a/commit.sh b/commit.sh old mode 100644 new mode 100755 diff --git a/design.txt b/design.txt old mode 100644 new mode 100755 diff --git a/icon.png b/icon.png old mode 100644 new mode 100755 diff --git a/icon_large.png b/icon_large.png old mode 100644 new mode 100755 diff --git a/icon_small.png b/icon_small.png old mode 100644 new mode 100755 diff --git a/include/blt/config.h.in b/include/blt/config.h.in old mode 100644 new mode 100755 diff --git a/include/blt/fs/filesystem.h b/include/blt/fs/filesystem.h old mode 100644 new mode 100755 diff --git a/include/blt/fs/loader.h b/include/blt/fs/loader.h old mode 100644 new mode 100755 diff --git a/include/blt/fs/nbt.h b/include/blt/fs/nbt.h old mode 100644 new mode 100755 diff --git a/include/blt/fs/nbt_block.h b/include/blt/fs/nbt_block.h old mode 100644 new mode 100755 diff --git a/include/blt/math/averages.h b/include/blt/math/averages.h old mode 100644 new mode 100755 diff --git a/include/blt/math/log_util.h b/include/blt/math/log_util.h old mode 100644 new mode 100755 diff --git a/include/blt/math/math.h b/include/blt/math/math.h old mode 100644 new mode 100755 diff --git a/include/blt/math/matrix.h b/include/blt/math/matrix.h old mode 100644 new mode 100755 diff --git a/include/blt/math/vectors.h b/include/blt/math/vectors.h old mode 100644 new mode 100755 diff --git a/include/blt/parse/argparse.h b/include/blt/parse/argparse.h old mode 100644 new mode 100755 diff --git a/include/blt/parse/mustache.h b/include/blt/parse/mustache.h old mode 100644 new mode 100755 diff --git a/include/blt/profiling/profiler.h b/include/blt/profiling/profiler.h old mode 100644 new mode 100755 diff --git a/include/blt/std/binary_tree.h b/include/blt/std/binary_tree.h old mode 100644 new mode 100755 diff --git a/include/blt/std/format.h b/include/blt/std/format.h old mode 100644 new mode 100755 diff --git a/include/blt/std/hashmap.h b/include/blt/std/hashmap.h old mode 100644 new mode 100755 diff --git a/include/blt/std/logging.h b/include/blt/std/logging.h old mode 100644 new mode 100755 diff --git a/include/blt/std/memory.h b/include/blt/std/memory.h old mode 100644 new mode 100755 index 2d27854..a6436e9 --- a/include/blt/std/memory.h +++ b/include/blt/std/memory.h @@ -193,6 +193,21 @@ namespace blt return *this; } + /** + * Resize the internal buffer. Nothing will occur if the sizes are equal. + * This function WILL NOT COPY ANY DATA. It is meant for use when creating a scoped buffer without size. + */ + constexpr void resize(size_t size) + { + if (size == 0) + return; + if (size == size_) + return; + delete[] buffer_; + buffer_ = new T[size]; + size_ = size; + } + constexpr inline T& operator[](size_t index) { return buffer_[index]; @@ -232,7 +247,7 @@ namespace blt { return buffer_; } - + // inline auto begin() // { // return ptr_iterator{buffer_}; @@ -282,7 +297,7 @@ namespace blt { return reverse_iterator{cbegin()}; } - + ~scoped_buffer() { delete[] buffer_; diff --git a/include/blt/std/queue.h b/include/blt/std/queue.h old mode 100644 new mode 100755 diff --git a/include/blt/std/random.h b/include/blt/std/random.h old mode 100644 new mode 100755 diff --git a/include/blt/std/string.h b/include/blt/std/string.h old mode 100644 new mode 100755 diff --git a/include/blt/std/system.h b/include/blt/std/system.h old mode 100644 new mode 100755 diff --git a/include/blt/std/time.h b/include/blt/std/time.h old mode 100644 new mode 100755 diff --git a/include/blt/std/uuid.h b/include/blt/std/uuid.h old mode 100644 new mode 100755 diff --git a/include/blt/window/window.h b/include/blt/window/window.h old mode 100644 new mode 100755 diff --git a/src/blt/fs/filesystem.cpp b/src/blt/fs/filesystem.cpp old mode 100644 new mode 100755 diff --git a/src/blt/fs/loader.cpp b/src/blt/fs/loader.cpp old mode 100644 new mode 100755 diff --git a/src/blt/fs/nbt.cpp b/src/blt/fs/nbt.cpp old mode 100644 new mode 100755 diff --git a/src/blt/fs/nbt_block.cpp b/src/blt/fs/nbt_block.cpp old mode 100644 new mode 100755 diff --git a/src/blt/parse/argparse.cpp b/src/blt/parse/argparse.cpp old mode 100644 new mode 100755 diff --git a/src/blt/profiling/profiler.cpp b/src/blt/profiling/profiler.cpp old mode 100644 new mode 100755 diff --git a/src/blt/std/format.cpp b/src/blt/std/format.cpp old mode 100644 new mode 100755 diff --git a/src/blt/std/logging.cpp b/src/blt/std/logging.cpp old mode 100644 new mode 100755 diff --git a/src/blt/std/string.cpp b/src/blt/std/string.cpp old mode 100644 new mode 100755 diff --git a/src/blt/std/system.cpp b/src/blt/std/system.cpp old mode 100644 new mode 100755 diff --git a/src/blt/window/window.cpp b/src/blt/window/window.cpp old mode 100644 new mode 100755 diff --git a/tests/clean.sh b/tests/clean.sh old mode 100644 new mode 100755 diff --git a/tests/src/binary_trees.h b/tests/src/binary_trees.h old mode 100644 new mode 100755 diff --git a/tests/src/hashmap_tests.h b/tests/src/hashmap_tests.h old mode 100644 new mode 100755 diff --git a/tests/src/logging.h b/tests/src/logging.h old mode 100644 new mode 100755 diff --git a/tests/src/main.cpp b/tests/src/main.cpp old mode 100644 new mode 100755 diff --git a/tests/src/nbt_tests.cpp b/tests/src/nbt_tests.cpp old mode 100644 new mode 100755 diff --git a/tests/src/nbt_tests.h b/tests/src/nbt_tests.h old mode 100644 new mode 100755 diff --git a/tests/src/profiling_tests.h b/tests/src/profiling_tests.h old mode 100644 new mode 100755 diff --git a/tests/src/queue_tests.h b/tests/src/queue_tests.h old mode 100644 new mode 100755 diff --git a/tests/test.sh b/tests/test.sh old mode 100644 new mode 100755