diff --git a/README.md b/README.md
index 118daa7..b54f97f 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
-# General Utility Library for C++17
+# General Utility Library for C++20
-The General Utility Library for C++17 (GUL17) contains often-used utility functions and
+The General Utility Library for C++20 (GUL20) contains often-used utility functions and
types that form the foundation for other libraries and programs. The main fields covered
by the library are:
@@ -15,7 +15,7 @@ by the library are:
* Backports from new standard library extensions
To get started, have a look at the
-[documentation website](https://gul-cpp.github.io/gul17/).
+[documentation website](https://gul-cpp.github.io/gul20/).
Here you find more detailed information on:
@@ -29,20 +29,13 @@ Here you find more detailed information on:
* [Versioning](#Versioning)
* [Version number examples](#Version-number-examples)
-## Installing with vcpkg
-
-GUL17 is available from the [vcpkg](https://vcpkg.io/) package manager. Once you have
-vcpkg installed, just run:
-
-vcpkg install gul17
-
## Building
-Needless to say, GUL17 needs a C++17 compliant compiler. To get started, clone this
+Needless to say, GUL20 needs a C++20 compliant compiler. To get started, clone this
repository:
- git clone https://github.com/gul-cpp/gul17.git
- cd gul17
+ git clone https://github.com/gul-cpp/gul20.git
+ cd gul20
Use meson to configure the build you want to have. A list of the
[build options](#Build-configuration-switches) is given below. Build directory name can be
@@ -181,9 +174,9 @@ generate the HTML pages.
## Versioning
-The version number for GUL17 resides in the LIBNO file.
+The version number for GUL20 resides in the LIBNO file.
-GUL17 follows a calendar-oriented versioning scheme with a version number of the
+GUL20 follows a calendar-oriented versioning scheme with a version number of the
form YY.M.minor where YY stands for the last two digits of the year, M is the
number of the month, and minor is a minor version number that starts from zero
for each release in that month.
diff --git a/data/Doxyfile.in b/data/Doxyfile.in
index 126415c..c270404 100644
--- a/data/Doxyfile.in
+++ b/data/Doxyfile.in
@@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8
# title of most generated pages and in a few other places.
# The default value is: My Project.
-PROJECT_NAME = "General Utility Library for C++17"
+PROJECT_NAME = "General Utility Library for C++20"
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
# could be handy for archiving the generated documentation or if some version
@@ -811,7 +811,7 @@ RECURSIVE = YES
# Note that relative paths are relative to the directory from which doxygen is
# run.
-EXCLUDE = include/gul17/catch.h
+EXCLUDE =
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
diff --git a/data/doxygen.h b/data/doxygen.h
index 2f19ed4..eb65e86 100644
--- a/data/doxygen.h
+++ b/data/doxygen.h
@@ -4,7 +4,7 @@
* \date Created on August 24, 2018
* \brief Doxygen input file for the General Utility Library.
*
- * \copyright Copyright 2018-2025 Deutsches Elektronen-Synchrotron (DESY), Hamburg
+ * \copyright Copyright 2018-2026 Deutsches Elektronen-Synchrotron (DESY), Hamburg
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
@@ -23,7 +23,7 @@
/**
* Namespace gul17 contains all functions and classes of the General Utility Library.
*/
-namespace gul17 {
+namespace GULNS {
/**
* \mainpage
@@ -32,7 +32,7 @@ namespace gul17 {
*
* \section introduction Introduction
*
- * The General Utility Library for C++17 (GUL17) contains often-used utility functions and
+ * The General Utility Library for C++20 (GUL20) contains often-used utility functions and
* types that form the foundation for other libraries and programs. The main fields
* covered by the library are:
*
@@ -58,9 +58,9 @@ namespace gul17 {
* We strive for a very high quality level. To ensure this, we follow a list of
* \ref quality_standards.
*
- * \section who_is_using_the_library Who Is Using GUL17?
+ * \section who_is_using_the_library Who Is Using GUL20?
*
- * GUL17 was developed at the German national particle accelerator laboratory
+ * GUL20 was developed at the German national particle accelerator laboratory
* DESY. It was originally meant to provide a modern and
* well-tested foundation for the DOOCS control
* system which drives most of the lab's accelerators. It is still used mainly in this
@@ -71,27 +71,31 @@ namespace gul17 {
*
* To use the library:
*
- * - Include the main header file \ref gul17/gul.h (or read more under
+ * - Include the main header file \ref gul20/gul.h (or read more under
* \ref how_to_include_gul_headers).
- * - Link your code against the library (-lgul17).
+ * - Link your code against the library (-lgul20).
* - If you are on Windows, see \ref using_gul_on_windows.
*
- * All functions and classes are enclosed in the namespace \ref gul17.
+ * All functions and classes are enclosed in the namespace \ref gul20.
*
- * GUL17 requires at least C++17. It works fine with newer versions of the standard, but
- * might use its own backport types (e.g. gul17::expected) in function interfaces.
+ * GUL20 requires at least C++20. It works fine with newer versions of the standard, but
+ * might use its own backport types (e.g. gul20::expected) in function interfaces.
*
* \section installation Installation
*
+ * \if GUL20_VCPKG_READY
* If you are using the [vcpkg](https://vcpkg.io/) package manager, you can install the
* library simply by running:
- * \verbatim vcpkg install gul17\endverbatim
- * Otherwise, you may have to build and install it manually. Have a look at the
- * [readme file on GitHub](https://github.com/gul-cpp/gul17/blob/main/README.md).
+ * \verbatim vcpkg install gul20\endverbatim
+ * Otherwise, you may have to build and install it manually.
+ * \endif
+ *
+ * Have a look at the
+ * [readme file on GitHub](https://github.com/gul-cpp/gul20/blob/main/README.md).
*
* \section source_code Obtaining the Source Code
*
- * You can browse or clone the source code at https://github.com/gul-cpp/gul17.git.
+ * You can browse or clone the source code at https://github.com/gul-cpp/gul20.git.
*
* \section contributing Contributing
*
@@ -112,38 +116,44 @@ namespace gul17 {
*/
/**
- * \page how_to_include_gul_headers How to Include GUL17 Headers
+ * \page how_to_include_gul_headers How to Include GUL20 Headers
*
- * All header files of the library reside under `gul17/` with no further subdirectories.
- * To get access to almost all of GUL17's functionality, it is sufficient to include the
+ * All header files of the library reside under `gul20/` with no further subdirectories.
+ * To get access to almost all of GUL20's functionality, it is sufficient to include the
* all-in-one header:
* \code
- * #include
+ * #include
* \endcode
*
- * Howard Hinnant's `gul17/date.h` header for calendar date functionality is not included
+ * Howard Hinnant's `gul20/date.h` header for calendar date functionality is not included
* in this header file, chiefly because of its negative impact on compile times. Just
* include it directly where needed.
*
* If you prefer to shave the last seconds off your build times, you are of course free to
- * include also the other GUL17 headers individually without going through `gul.h`. Just
+ * include also the other GUL20 headers individually without going through `gul.h`. Just
* follow the documentation of the classes and functions you use to find the associated
* header files.
*
* We do not guarantee that individual header file names will never change (except for
- * `gul17/gul.h`), but we can assure you that this will happen rarely, if ever.
+ * `gul20/gul.h`), but we can assure you that this will happen rarely, if ever.
*/
/**
* \page release_notes Release Notes
*
- * GUL17 releases follow a calendar-oriented versioning scheme with a version number of
+ * GUL20 releases follow a calendar-oriented versioning scheme with a version number of
* the form `YY.M.minor` where `YY` stands for the last two digits of the year, `M` is the
* number of the month, and `minor` is a minor version number that starts from zero for
- * each release in that month. For instance, the first release in March 2025 was called
- * 25.3.0, the second could have been called 24.3.1. This is not semantic
+ * each release in that month. For instance, the first release in February 2026 was called
+ * 26.2.0, the second could have been called 26.2.1. This is not semantic
* versioning.
*
+ * \section changelog_gul20 GUL20 Versions
+ *
+ * - Initial release of GUL20. Compared to GUL17, backports of C++20 standard library
+ * features (e.g. span, remove_cvref) are removed.
+ *
+ *
* \section changelog_gul17 GUL17 Versions
*
* \subsection V26_2_0 Version 26.2.0
@@ -176,6 +186,7 @@ namespace gul17 {
* features (e.g. string_view, optional) are removed, and the build system is
* simplified.
*
+ *
* \section changelog_2_x GUL14: 2.x Versions
*
* \subsection V2_13_0 Version 2.13.0
@@ -354,14 +365,14 @@ namespace gul17 {
*
* The following individuals contributed to the General Utility Library:
*
- * > Lars Fröhlich, Sören Grunewald, Olaf Hensler, Fini Jastrow, Josef Wilgen
+ * > Jan Behrens, Lars Fröhlich, Sören Grunewald, Olaf Hensler, Fini Jastrow
*
* Additional code distributed with this library was written by authors listed under
* \ref additional_copyright_notices below.
*
* \section copyright_notice Copyright Notice
*
- * Copyright 2018-2025 Deutsches Elektronen-Synchrotron (DESY), Hamburg
+ * Copyright 2018-2026 Deutsches Elektronen-Synchrotron (DESY), Hamburg
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
@@ -393,11 +404,6 @@ namespace gul17 {
* dedicated all copyright and related and neighboring rights to this software to the
* public domain worldwide. This software is distributed without any warranty.
* \ref license_cc0_public_domain and \ref expected.h for details).
- *
- * \ref span.h
- * Copyright 2018 Tristan Brindle.
- * Distributed under the Boost Software License, Version 1.0 (see
- * \ref license_boost_1_0 and \ref span.h for details).
*
*/
@@ -536,7 +542,7 @@ namespace gul17 {
* Furthermore, the library includes Howard Hinnant's date.h header, which extends C++17's
* `` library with types and functionality for handling calendar dates. Most of
* this functionality has been standardized in C++20. Documentation is available on
- * [GitHub](https://howardhinnant.github.io/date/date.html); just note that the GUL17
+ * [GitHub](https://howardhinnant.github.io/date/date.html); just note that the GUL20
* version lives in the namespace `gul17::date`.
*/
@@ -667,12 +673,6 @@ namespace gul17 {
* \ref gul17::OverloadSet "OverloadSet":
* A class template that works like an overload set of functions, mainly for use with
* std::visit().
- *
- * \ref gul17::remove_cvref "remove_cvref":
- * A metafunction to remove const, volatile, and reference qualifiers from a type.
- * This is a backport of
- * [std::remove_cvref](https://en.cppreference.com/w/cpp/types/remove_cvref) from
- * C++20.
*/
/**
@@ -691,17 +691,6 @@ namespace gul17 {
* error value. It should behave like
* [std::expected](https://en.cppreference.com/w/cpp/utility/expected)
* from C++23 for almost all use cases.
- *
- * \ref gul17::remove_cvref "remove_cvref":
- * A metafunction to remove const, volatile, and reference qualifiers from a type.
- * This is a backport of
- * [std::remove_cvref](https://en.cppreference.com/w/cpp/types/remove_cvref) from
- * C++20.
- *
- * \ref gul17::span "span":
- * A view to a contiguous sequence of objects. It should behave like
- * [std::span](https://en.cppreference.com/w/cpp/container/span) from C++20 for almost
- * all use cases.
*/
/**
@@ -711,10 +700,6 @@ namespace gul17 {
* version 3 for its unit tests. Please refer to
* https://github.com/catchorg/Catch2/blob/master/docs/tutorial.md for an introduction to
* Catch2.
- *
- * \note
- * The predecessor library GUL14 included a header-only version of Catch2. This header is
- * no longer available in GUL17. Catch2 must be installed separately.
*/
/**
@@ -980,9 +965,9 @@ namespace gul17 {
*/
/**
- * \defgroup date_h gul17/date.h
+ * \defgroup date_h gul20/date.h
* \brief Calendar date library by Howard Hinnant.
* \see https://github.com/HowardHinnant/date
*/
-} // namespace gul17
+} // namespace GULNS
diff --git a/data/how_to_create_a_vcpkg_port.txt b/data/how_to_create_a_vcpkg_port.txt
index 419f1e7..a0296d3 100644
--- a/data/how_to_create_a_vcpkg_port.txt
+++ b/data/how_to_create_a_vcpkg_port.txt
@@ -1,17 +1,17 @@
-These are some notes on how to create a new vcpkg port for GUL17, e.g. after the
+These are some notes on how to create a new vcpkg port for GUL20, e.g. after the
release of an update. This assumes that a fork of https://github.com/microsoft/vcpkg.git
is checked out.
-1. Edit ports/gul17/portfile.cmake
+1. Edit ports/gul20/portfile.cmake
Change REF to new version tag or git hash
Change SHA512 to 0
-2. Edit ports/gul17/vcpkg.json
+2. Edit ports/gul20/vcpkg.json
Change version number
3. Run vcpkg remove --outdated
- This should remove the outdated GUL17 version (if any)
+ This should remove the outdated GUL20 version (if any)
4. Run vcpkg install gul17
It should fail and show you the new SHA512 hash
-5. Edit ports/gul17/portfile.cmake
+5. Edit ports/gul20/portfile.cmake
Change SHA512 to new hash
6. Add port to vcpkg repository
git add ports/gul17
diff --git a/debian/copyright b/debian/copyright
index 783121d..6a2e508 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,15 +1,10 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Files: *
-Copyright: 2018-2024 libgul contributors
- 2018-2024 DESY
+Copyright: 2018-2026 Deutsches Elektronen-Synchrotron (DESY)
License: LGPL-2.1+
-Files: include/gul17/catch.h
-Copyright: 2019 Two Blue Cubes Ltd.
-License: BSL-1.0
-
-Files: include/gul17/date.h
+Files: include/gul20/date.h
Copyright: 2015-2017 Howard Hinnant
2016 Adrian Colomitchi
2017 Florian Dang
@@ -19,16 +14,11 @@ Copyright: 2015-2017 Howard Hinnant
2022 libgul contributors (L. Fröhlich)
License: Expat
-Files: include/gul17/expected.h
+Files: include/gul20/expected.h
Copyright: 2017 Sy Brand
2023-2024 libgul contributors (L. Fröhlich)
License: CC0
-Files: include/gul17/span.h
-Copyright: 2018 Tristan Brindle
- 2019 libgul contributors (L. Fröhlich)
-License: BSL-1.0
-
License: LGPL-2.1+
This package is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -44,31 +34,6 @@ License: LGPL-2.1+
License along with this package; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-License: BSL-1.0
- Boost Software License - Version 1.0 - August 17th, 2003
- .
- Permission is hereby granted, free of charge, to any person or organization
- obtaining a copy of the software and accompanying documentation covered by
- this license (the "Software") to use, reproduce, display, distribute,
- execute, and transmit the Software, and to prepare derivative works of the
- Software, and to permit third-parties to whom the Software is furnished to
- do so, all subject to the following:
- .
- The copyright notices in the Software and this entire statement, including
- the above license grant, this restriction and the following disclaimer,
- must be included in all copies of the Software, in whole or in part, and
- all derivative works of the Software, unless such copies or derivative
- works are solely in the form of machine-executable object code generated by
- a source language processor.
- .
- 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, TITLE AND NON-INFRINGEMENT. IN NO EVENT
- SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
- FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
-
License: Expat
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
diff --git a/examples/thread_pool.cc b/examples/thread_pool.cc
index 30973bb..eb45f3c 100644
--- a/examples/thread_pool.cc
+++ b/examples/thread_pool.cc
@@ -4,7 +4,7 @@
* \date Created on February 9, 2024
* \brief Example on how to use the ThreadPool.
*
- * \copyright Copyright 2024 Deutsches Elektronen-Synchrotron (DESY), Hamburg
+ * \copyright Copyright 2024-2026 Deutsches Elektronen-Synchrotron (DESY), Hamburg
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
@@ -22,10 +22,10 @@
#include
-#include
-#include
+#include
+#include
-using namespace gul17;
+using namespace GULNS;
using std::cout;
using namespace std::literals;
@@ -37,7 +37,7 @@ int main()
auto pool = make_thread_pool(2);
pool->add_task([]() { cout << "Task 1\n"; });
- pool->add_task([]() { sleep(1); std::cout << "Task 2\n"; });
+ pool->add_task([]() { sleep(1.0); std::cout << "Task 2\n"; });
// Tasks can be scheduled to start later:
// This one should start 2 seconds after enqueueing (if a thread is available)
diff --git a/examples/trim.cc b/examples/trim.cc
index ce02483..9e0dbec 100644
--- a/examples/trim.cc
+++ b/examples/trim.cc
@@ -21,14 +21,14 @@
*/
#include
-#include
+#include
-using gul17::trim_left_sv;
-using gul17::trim_left;
-using gul17::trim_right_sv;
-using gul17::trim_right;
-using gul17::trim_sv;
-using gul17::trim;
+using GULNS::trim_left_sv;
+using GULNS::trim_left;
+using GULNS::trim_right_sv;
+using GULNS::trim_right;
+using GULNS::trim_sv;
+using GULNS::trim;
using std::cout;
int main()
diff --git a/gul17.spec b/gul17.spec
deleted file mode 100644
index bb35f24..0000000
--- a/gul17.spec
+++ /dev/null
@@ -1,107 +0,0 @@
-#
-# This file is used to build RPMS for gul17
-#
-# To use it do the following:
-#
-# 1) create a dist tarball
-# $ meson build && ninja -C build dist
-#
-# 2) Prepare the rpm build environment
-# $ pkcon install rpmdevtools
-# $ rpmdev-setuptree
-# $ cp build/meson-dist/gul17-.tar.xz ~/rpmbuild/SOURCES
-# $ cp gul17.spec ~/rpmbuild/SPECS
-#
-# 3) Build the package
-# $ cd ~/rpmbuild
-# $ rpmbuild -ba SPECS/gul17.spec
-#
-# https://rpm-packaging-guide.github.io/
-#
-
-Name: gul17
-Version: 25.4.1
-Release: 1%{?dist}
-Summary: General Utility Library
-
-License: LGPL-2.1+
-URL: https://github.com/gul-cpp/gul17
-Source0: gul17-%{version}.tar.xz
-
-%if 0%{?rhel} < 8
-BuildRequires: devtoolset-7-gcc-c++
-# This is needed to fix an issue with the currently meson
-# package, it might be obsolete as soon as a new meson
-# package is rolled out.
-BuildRequires: epel-rpm-macros
-%endif
-BuildRequires: gcc-c++
-BuildRequires: meson
-BuildRequires: ninja-build
-# we actually use some git checks in meson
-BuildRequires: git-core
-
-%description
-The general utility library for C++17 contains often-used
-utility functions and types that form the foundation for
-other libraries and programs.
-
-%package devel
-Summary: Development libraries and header files for %{name}
-Requires: %{name}%{?_isa} = %{version}-%{release}
-# We can use BuildRequire: pkgconfig(gul17)
-# in using projects to automatically use either one:
-##Requires: pkgconfig
-##Requires: pkgconf-pkg-config
-
-%description devel
-%{summary}.
-
-%package static
-Summary: Static libraries for %{name}
-Requires: %{name}-devel%{?_isa} = %{version}-%{release}
-
-%description static
-%{summary}.
-
-%ifarch %{arm} aarch64
-# Disable the creation of debug packages on ARM
-%global debug_package %{nil}
-%endif
-
-%prep
-%setup -q -n gul17-%{version}
-
-%build
-%meson
-%meson_build
-
-%install
-%meson_install
-
-%check
-%meson_test
-
-%files
-%{_libdir}/lib%{name}.so.*
-
-%files devel
-%{_libdir}/lib%{name}.so
-%{_libdir}/pkgconfig/%{name}.pc
-%{_includedir}/gul17/*
-
-%files static
-%{_libdir}/lib%{name}.a
-
-%changelog
-* Mon Jun 16 2025 Fini Jastrow - 25.4.1-1
-- New upstream release
-
-* Fri Feb 16 2024 Soeren Grunewald - 2.10-1
-- New upstream release
-
-* Thu Oct 13 2022 Soeren Grunewald - 2.7-1
-- New upstream release
-
-* Thu Aug 19 2021 Soeren Grunewald - 2.6-1
-- Initial release
diff --git a/include/gul17/span.h b/include/gul17/span.h
deleted file mode 100644
index 687c3a5..0000000
--- a/include/gul17/span.h
+++ /dev/null
@@ -1,567 +0,0 @@
-/**
- * \file span.h
- * \author Tristan Brindle
- * \brief Provides a gul17::span that mimicks C++20's std::span as closely as possible.
- *
- * \copyright
- * Copyright Tristan Brindle 2018.
- * Copyright Deutsches Elektronen-Synchrotron (DESY), Hamburg 2019-2025 (modifications for
- * GUL, \ref contributors).
- *
- * Distributed under the Boost Software License, Version 1.0. (See \ref license_boost_1_0
- * or http://www.boost.org/LICENSE_1_0.txt)
- *
- * For more information, see http://www.boost.org
- *
- * This is an implementation of C++20's std::span
- * http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/n4820.pdf
- */
-
-#ifndef GUL17_SPAN_H_
-#define GUL17_SPAN_H_
-
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include "gul17/traits.h"
-
-namespace gul17 {
-
-/**
- * \addtogroup span_h gul17/span.h
- * \brief Backport of std::span from C++20.
- * @{
- */
-
-/// \cond HIDE_SYMBOLS
-
-constexpr std::size_t dynamic_extent = SIZE_MAX;
-
-template
-class span;
-
-namespace detail {
-
-template
-struct span_storage {
- constexpr span_storage() noexcept = default;
-
- constexpr span_storage(E* pointer, std::size_t /*unused*/) noexcept : ptr(pointer)
- {}
-
- E* ptr = nullptr;
- static constexpr std::size_t size = S;
-};
-
-template
-struct span_storage {
- constexpr span_storage() noexcept = default;
-
- constexpr span_storage(E* pointer, std::size_t sz) noexcept
- : ptr(pointer), size(sz)
- {}
-
- E* ptr = nullptr;
- std::size_t size = 0;
-};
-
-template
-constexpr auto size(const C& c) -> decltype(c.size())
-{
- return c.size();
-}
-
-template
-constexpr std::size_t size(const T (&)[N]) noexcept
-{
- return N;
-}
-
-template
-constexpr auto data(C& c) -> decltype(c.data())
-{
- return c.data();
-}
-
-template
-constexpr auto data(const C& c) -> decltype(c.data())
-{
- return c.data();
-}
-
-template
-constexpr T* data(T (&array)[N]) noexcept
-{
- return array;
-}
-
-template
-constexpr const E* data(std::initializer_list il) noexcept
-{
- return il.begin();
-}
-
-template
-struct is_span : std::false_type {};
-
-template
-struct is_span> : std::true_type {};
-
-template
-struct is_std_array : std::false_type {};
-
-template
-struct is_std_array> : std::true_type {};
-
-template
-struct has_size_and_data : std::false_type {};
-
-template
-struct has_size_and_data())),
- decltype(detail::data(std::declval()))>>
- : std::true_type {};
-
-template >
-struct is_container {
- static constexpr bool value =
- !is_span::value && !is_std_array::value &&
- !std::is_array::value && has_size_and_data::value;
-};
-
-template
-using remove_pointer_t = typename std::remove_pointer::type;
-
-template
-struct is_container_element_type_compatible : std::false_type {};
-
-template
-struct is_container_element_type_compatible<
- T, E, std::void_t()))>>
- : std::is_convertible<
- remove_pointer_t()))> (*)[],
- E (*)[]> {};
-
-template
-struct is_complete : std::false_type {};
-
-template
-struct is_complete : std::true_type {};
-
-} // namespace detail
-
-
-/// \endcond
-
-
-/**
- * A view to a contiguous sequence of objects. This is a backport of
- * [std::span](https://en.cppreference.com/w/cpp/container/span) from C++20.
- *
- * \since GUL version 1.9
- */
-template
-class span {
- static_assert(std::is_object::value,
- "A span's ElementType must be an object type (not a "
- "reference type or void)");
- static_assert(detail::is_complete::value,
- "A span's ElementType must be a complete type (not a forward "
- "declaration)");
- static_assert(!std::is_abstract::value,
- "A span's ElementType cannot be an abstract class type");
-
- using storage_type = detail::span_storage;
-
-public:
- // constants and types
- using element_type = ElementType; ///< See [std::span](https://en.cppreference.com/w/cpp/container/span).
- using value_type = typename std::remove_cv::type; ///< See [std::span](https://en.cppreference.com/w/cpp/container/span).
- using index_type = std::size_t; ///< See [std::span](https://en.cppreference.com/w/cpp/container/span).
- using difference_type = std::ptrdiff_t; ///< See [std::span](https://en.cppreference.com/w/cpp/container/span).
- using pointer = element_type*; ///< See [std::span](https://en.cppreference.com/w/cpp/container/span).
- using const_pointer = const element_type*; ///< See [std::span](https://en.cppreference.com/w/cpp/container/span).
- using reference = element_type&; ///< See [std::span](https://en.cppreference.com/w/cpp/container/span).
- using iterator = pointer; ///< See [std::span](https://en.cppreference.com/w/cpp/container/span).
- using const_iterator = const_pointer; ///< See [std::span](https://en.cppreference.com/w/cpp/container/span).
- using reverse_iterator = std::reverse_iterator; ///< See [std::span](https://en.cppreference.com/w/cpp/container/span).
- using const_reverse_iterator = std::reverse_iterator; ///< See [std::span](https://en.cppreference.com/w/cpp/container/span).
-
- /// See [std::span](https://en.cppreference.com/w/cpp/container/span).
- static constexpr index_type extent = Extent;
-
- // [span.cons], span constructors, copy, assignment, and destructor
- /// See [std::span](https://en.cppreference.com/w/cpp/container/span).
- template <
- std::size_t E = Extent,
- typename std::enable_if<(E == dynamic_extent || E <= 0), int>::type = 0>
- constexpr span() noexcept
- {}
-
- /// See [std::span](https://en.cppreference.com/w/cpp/container/span).
- constexpr span(pointer ptr, index_type count)
- : storage_(ptr, count)
- {}
-
- /// See [std::span](https://en.cppreference.com/w/cpp/container/span).
- constexpr span(pointer first_elem, pointer last_elem)
- : storage_(first_elem, static_cast(last_elem - first_elem))
- {}
-
- /// See [std::span](https://en.cppreference.com/w/cpp/container/span).
- template ::value,
- int>::type = 0>
- constexpr span(element_type (&arr)[N]) noexcept : storage_(arr, N)
- {}
-
- /// See [std::span](https://en.cppreference.com/w/cpp/container/span).
- template &, ElementType>::value,
- int>::type = 0>
- span(std::array& arr) noexcept
- : storage_(arr.data(), N)
- {}
-
- /// See [std::span](https://en.cppreference.com/w/cpp/container/span).
- template &, ElementType>::value,
- int>::type = 0>
- span(const std::array& arr) noexcept
- : storage_(arr.data(), N)
- {}
-
- /// See [std::span](https://en.cppreference.com/w/cpp/container/span).
- template <
- typename Container, std::size_t E = Extent,
- typename std::enable_if<
- E == dynamic_extent && detail::is_container::value &&
- detail::is_container_element_type_compatible<
- Container&, ElementType>::value,
- int>::type = 0>
- constexpr span(Container& cont)
- : storage_(detail::data(cont), detail::size(cont))
- {}
-
- /// See [std::span](https://en.cppreference.com/w/cpp/container/span).
- template <
- typename Container, std::size_t E = Extent,
- typename std::enable_if<
- E == dynamic_extent && detail::is_container::value &&
- detail::is_container_element_type_compatible<
- const Container&, ElementType>::value,
- int>::type = 0>
- constexpr span(const Container& cont)
- : storage_(detail::data(cont), detail::size(cont))
- {}
-
- /// See [std::span](https://en.cppreference.com/w/cpp/container/span).
- constexpr span(const span& other) noexcept = default;
-
- /// See [std::span](https://en.cppreference.com/w/cpp/container/span).
- template ::value,
- int>::type = 0>
- constexpr span(const span& other) noexcept
- : storage_(other.data(), other.size())
- {}
-
- /// See [std::span](https://en.cppreference.com/w/cpp/container/span).
- ~span() noexcept = default;
-
- /// See [std::span](https://en.cppreference.com/w/cpp/container/span).
- constexpr span&
- operator=(const span& other) noexcept = default;
-
- // [span.sub], span subviews
- /// See [std::span](https://en.cppreference.com/w/cpp/container/span).
- template
- constexpr span first() const
- {
- return {data(), Count};
- }
-
- /// See [std::span](https://en.cppreference.com/w/cpp/container/span).
- template
- constexpr span last() const
- {
- return {data() + (size() - Count), Count};
- }
-
- /// See [std::span](https://en.cppreference.com/w/cpp/container/span).
- template
- using subspan_return_t =
- span;
-
- /// See [std::span](https://en.cppreference.com/w/cpp/container/span).
- template
- constexpr subspan_return_t subspan() const
- {
- return {data() + Offset,
- Count != dynamic_extent ? Count : size() - Offset};
- }
-
- /// See [std::span](https://en.cppreference.com/w/cpp/container/span).
- constexpr span
- first(index_type count) const
- {
- return {data(), count};
- }
-
- /// See [std::span](https://en.cppreference.com/w/cpp/container/span).
- constexpr span
- last(index_type count) const
- {
- return {data() + (size() - count), count};
- }
-
- /// See [std::span](https://en.cppreference.com/w/cpp/container/span).
- constexpr span
- subspan(index_type offset, index_type count = dynamic_extent) const
- {
- return {data() + offset,
- count == dynamic_extent ? size() - offset : count};
- }
-
- // [span.obs], span observers
- /// See [std::span](https://en.cppreference.com/w/cpp/container/span).
- constexpr index_type size() const noexcept { return storage_.size; }
-
- /// See [std::span](https://en.cppreference.com/w/cpp/container/span).
- constexpr index_type size_bytes() const noexcept
- {
- return size() * sizeof(element_type);
- }
-
- /// See [std::span](https://en.cppreference.com/w/cpp/container/span).
- constexpr bool empty() const noexcept
- {
- return size() == 0;
- }
-
- // [span.elem], span element access
- /// See [std::span](https://en.cppreference.com/w/cpp/container/span).
- constexpr reference operator[](index_type idx) const
- {
- return *(data() + idx);
- }
-
- /// See [std::span](https://en.cppreference.com/w/cpp/container/span).
- constexpr reference front() const
- {
- return *data();
- }
-
- /// See [std::span](https://en.cppreference.com/w/cpp/container/span).
- constexpr reference back() const
- {
- return *(data() + (size() - 1));
- }
-
- /// See [std::span](https://en.cppreference.com/w/cpp/container/span).
- constexpr pointer data() const noexcept { return storage_.ptr; }
-
- // [span.iterators], span iterator support
- /// See [std::span](https://en.cppreference.com/w/cpp/container/span).
- constexpr iterator begin() const noexcept { return data(); }
-
- /// See [std::span](https://en.cppreference.com/w/cpp/container/span).
- constexpr iterator end() const noexcept { return data() + size(); }
-
- /// See [std::span](https://en.cppreference.com/w/cpp/container/span).
- constexpr const_iterator cbegin() const noexcept { return begin(); }
-
- /// See [std::span](https://en.cppreference.com/w/cpp/container/span).
- constexpr const_iterator cend() const noexcept { return end(); }
-
- /// See [std::span](https://en.cppreference.com/w/cpp/container/span).
- reverse_iterator rbegin() const noexcept
- {
- return reverse_iterator(end());
- }
-
- /// See [std::span](https://en.cppreference.com/w/cpp/container/span).
- reverse_iterator rend() const noexcept
- {
- return reverse_iterator(begin());
- }
-
- /// See [std::span](https://en.cppreference.com/w/cpp/container/span).
- const_reverse_iterator crbegin() const noexcept
- {
- return const_reverse_iterator(cend());
- }
-
- /// See [std::span](https://en.cppreference.com/w/cpp/container/span).
- const_reverse_iterator crend() const noexcept
- {
- return const_reverse_iterator(cbegin());
- }
-
- /// See [std::span](https://en.cppreference.com/w/cpp/container/span).
- friend constexpr iterator begin(span s) noexcept { return s.begin(); }
-
- /// See [std::span](https://en.cppreference.com/w/cpp/container/span).
- friend constexpr iterator end(span s) noexcept { return s.end(); }
-
-private:
- storage_type storage_{};
-};
-
-/// \cond HIDE_SYMBOLS
-
-/* Comparison operators */
-// Implementation note: the implementations of == and < are equivalent to
-// 4-legged std::equal and std::lexicographical_compare respectively
-
-template
-constexpr bool operator==(span lhs, span rhs)
-{
- if (lhs.size() != rhs.size()) {
- return false;
- }
-
- for (std::size_t i = 0; i < lhs.size(); i++) {
- if (lhs[i] != rhs[i]) {
- return false;
- }
- }
-
- return true;
-}
-
-template
-constexpr bool operator!=(span lhs, span rhs)
-{
- return !(lhs == rhs);
-}
-
-template
-constexpr bool operator<(span lhs, span rhs)
-{
- // No std::min to avoid dragging in
- const std::size_t size = lhs.size() < rhs.size() ? lhs.size() : rhs.size();
-
- for (std::size_t i = 0; i < size; i++) {
- if (lhs[i] < rhs[i]) {
- return true;
- }
- if (lhs[i] > rhs[i]) {
- return false;
- }
- }
- return lhs.size() < rhs.size();
-}
-
-template
-constexpr bool operator<=(span lhs, span rhs)
-{
- return !(rhs < lhs);
-}
-
-template
-constexpr bool operator>(span lhs, span rhs)
-{
- return rhs < lhs;
-}
-
-template
-constexpr bool operator>=(span lhs, span rhs)
-{
- return !(lhs < rhs);
-}
-
-/// \endcond
-
-/**
- * Return a constant view to the byte representation of the elements of a given span.
- *
- * This is a backport from the C++20 standard library, see:
- * https://en.cppreference.com/w/cpp/container/span/as_bytes
- *
- * \since GUL version 1.9
- */
-template
-span
-as_bytes(span s) noexcept
-{
- return {reinterpret_cast(s.data()), s.size_bytes()};
-}
-
-/**
- * Return a writable view to the byte representation of the elements of a given span.
- *
- * This is a backport from the C++20 standard library, see:
- * https://en.cppreference.com/w/cpp/container/span/as_bytes
- *
- * \since GUL version 1.9
- */
-template <
- class ElementType, size_t Extent,
- typename std::enable_if::value, int>::type = 0>
-span
-as_writable_bytes(span s) noexcept
-{
- return {reinterpret_cast(s.data()), s.size_bytes()};
-}
-
-/**
- * Return a reference to the Nth element of a given span.
- *
- * This is a backport from the C++20 standard library, see:
- * https://en.cppreference.com/w/cpp/container/span/get
- *
- * \since GUL version 1.9
- */
-template
-constexpr auto get(span s) -> decltype(s[N])
-{
- return s[N];
-}
-
-/// @}
-
-} // namespace gul17
-
-
-namespace std {
-
-template
-class tuple_size>
- : public integral_constant {};
-
-template
-class tuple_size>; // not defined
-
-template
-class tuple_element> {
-public:
- static_assert(Extent != gul17::dynamic_extent && I < Extent, "");
- using type = ElementType;
-};
-
-} // namespace std
-
-#endif
-
-// vi:ts=4:sw=4:sts=4:et
diff --git a/include/gul17/OverloadSet.h b/include/gul20/OverloadSet.h
similarity index 88%
rename from include/gul17/OverloadSet.h
rename to include/gul20/OverloadSet.h
index 982a82f..ae7ade1 100644
--- a/include/gul17/OverloadSet.h
+++ b/include/gul20/OverloadSet.h
@@ -4,7 +4,7 @@
* \authors \ref contributors
* \date Created on 15 June 2023
*
- * \copyright Copyright 2023-2025 Deutsches Elektronen-Synchrotron (DESY), Hamburg
+ * \copyright Copyright 2023-2026 Deutsches Elektronen-Synchrotron (DESY), Hamburg
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
@@ -20,13 +20,13 @@
* along with this program. If not, see .
*/
-#ifndef GUL17_OVERLOADSET_H_
-#define GUL17_OVERLOADSET_H_
+#ifndef GUL20_OVERLOADSET_H_
+#define GUL20_OVERLOADSET_H_
-namespace gul17 {
+namespace GULNS {
/**
- * \addtogroup variant_h gul17/variant.h
+ * \addtogroup variant_h gul20/variant.h
* \brief Implementation of the OverloadSet class template.
* @{
*/
@@ -37,7 +37,7 @@ namespace gul17 {
* \code{.cpp}
* std::variant v = 1.0;
* auto str = std::visit(
- * gul17::OverloadSet{
+ * GULNS::OverloadSet{
* [](char) { return "char"; },
* [](int) { return "int"; }
* }, v);
@@ -62,6 +62,6 @@ struct OverloadSet : Fcts ...
template
OverloadSet(Fcts...) -> OverloadSet;
-} // namespace gul17
+} // namespace GULNS
#endif
diff --git a/include/gul17/SlidingBuffer.h b/include/gul20/SlidingBuffer.h
similarity index 99%
rename from include/gul17/SlidingBuffer.h
rename to include/gul20/SlidingBuffer.h
index e013c36..a09ac11 100644
--- a/include/gul17/SlidingBuffer.h
+++ b/include/gul20/SlidingBuffer.h
@@ -4,7 +4,7 @@
* \date Created on Feb 7, 2019
* \brief Declaration of the SlidingBuffer class for the General Utility Library.
*
- * \copyright Copyright 2019-2023 Deutsches Elektronen-Synchrotron (DESY), Hamburg
+ * \copyright Copyright 2019-2026 Deutsches Elektronen-Synchrotron (DESY), Hamburg
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
@@ -20,21 +20,21 @@
* along with this program. If not, see .
*/
-#ifndef GUL17_SLIDINGBUFFER_H_
-#define GUL17_SLIDINGBUFFER_H_
+#ifndef GUL20_SLIDINGBUFFER_H_
+#define GUL20_SLIDINGBUFFER_H_
#include
#include
#include
#include
-#include "gul17/cat.h"
-#include "gul17/internal.h"
+#include "gul20/cat.h"
+#include "gul20/internal.h"
-namespace gul17 {
+namespace GULNS {
/**
- * \addtogroup SlidingBuffer_h gul17/SlidingBuffer.h
+ * \addtogroup SlidingBuffer_h gul20/SlidingBuffer.h
* \brief A ring buffer.
* @{
*/
@@ -410,7 +410,7 @@ class SlidingBuffer {
{
auto const s = size();
if (idx >= s) {
- throw std::out_of_range(gul17::cat("SlidingBuffer::", __func__,
+ throw std::out_of_range(GULNS::cat("SlidingBuffer::", __func__,
": idx (which is ", idx, ") >= this->size() (which is ", s, ")"));
}
return operator[](idx);
@@ -423,7 +423,7 @@ class SlidingBuffer {
{
auto const s = size();
if (idx >= s) {
- throw std::out_of_range(gul17::cat("SlidingBuffer::", __func__,
+ throw std::out_of_range(GULNS::cat("SlidingBuffer::", __func__,
": idx (which is ", idx, ") >= this->size() (which is ", s, ")"));
}
return operator[](idx);
@@ -1317,7 +1317,7 @@ class SlidingBufferExposed : public SlidingBuffer.
*/
-#ifndef GUL17_SMALLVECTOR_H_
-#define GUL17_SMALLVECTOR_H_
+#ifndef GUL20_SMALLVECTOR_H_
+#define GUL20_SMALLVECTOR_H_
#include
#include
@@ -33,13 +33,13 @@
#include
#include
-#include "gul17/internal.h"
-#include "gul17/cat.h"
+#include "gul20/internal.h"
+#include "gul20/cat.h"
-namespace gul17 {
+namespace GULNS {
/**
- * \addtogroup SmallVector_h gul17/SmallVector.h
+ * \addtogroup SmallVector_h gul20/SmallVector.h
* \brief A vector with small-buffer optimization.
* @{
*/
@@ -1661,7 +1661,7 @@ void swap(SmallVector& a, SmallVector
#include
@@ -36,10 +36,10 @@
#include
#include
-#include
-#include
+#include
+#include
-namespace gul17 {
+namespace GULNS {
class ThreadPool;
@@ -51,7 +51,7 @@ std::shared_ptr lock_pool_or_throw(std::weak_ptr pool);
} // namespace detail
/**
- * \addtogroup ThreadPool_h gul17/ThreadPool.h
+ * \addtogroup ThreadPool_h gul20/ThreadPool.h
* \brief A thread pool and task queue.
* @{
*/
@@ -81,7 +81,7 @@ enum class TaskState
*
* Each task is associated with a TaskHandle. This handle is returned by add_task() and
* can be used to query the status of the task or to remove it from the queue via
- * \ref gul17::ThreadPool::TaskHandle::cancel() "cancel()". Tasks that are already running
+ * \ref GULNS::ThreadPool::TaskHandle::cancel() "cancel()". Tasks that are already running
* cannot be canceled.
*
* \code{.cpp}
@@ -630,6 +630,6 @@ inline std::shared_ptr make_thread_pool(
/// @}
-} // namespace gul17
+} // namespace GULNS
-#endif // GUL17_THREADPOOL_H_
+#endif // GUL20_THREADPOOL_H_
diff --git a/include/gul17/Trigger.h b/include/gul20/Trigger.h
similarity index 96%
rename from include/gul17/Trigger.h
rename to include/gul20/Trigger.h
index c9b02c3..ef33508 100644
--- a/include/gul17/Trigger.h
+++ b/include/gul20/Trigger.h
@@ -4,7 +4,7 @@
* \date Created on September 21, 2018
* \brief Declaration of the Trigger class for the General Utility Library.
*
- * \copyright Copyright 2018-2023 Deutsches Elektronen-Synchrotron (DESY), Hamburg
+ * \copyright Copyright 2018-2026 Deutsches Elektronen-Synchrotron (DESY), Hamburg
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
@@ -20,19 +20,19 @@
* along with this program. If not, see .
*/
-#ifndef GUL17_TRIGGER_H_
-#define GUL17_TRIGGER_H_
+#ifndef GUL20_TRIGGER_H_
+#define GUL20_TRIGGER_H_
#include
#include
#include
-#include "gul17/internal.h"
+#include "gul20/internal.h"
-namespace gul17 {
+namespace GULNS {
/**
- * \addtogroup Trigger_h gul17/Trigger.h
+ * \addtogroup Trigger_h gul20/Trigger.h
* \brief A cross-thread trigger.
* @{
*/
@@ -223,6 +223,6 @@ class Trigger
/// @}
-} // namespace gul17
+} // namespace GULNS
#endif
diff --git a/include/gul17/bit_manip.h b/include/gul20/bit_manip.h
similarity index 95%
rename from include/gul17/bit_manip.h
rename to include/gul20/bit_manip.h
index b099c5b..cd88eb0 100644
--- a/include/gul17/bit_manip.h
+++ b/include/gul20/bit_manip.h
@@ -5,7 +5,7 @@
* \authors \ref contributors
* \date Created on 17 October 2019
*
- * \copyright Copyright 2019-2023 Deutsches Elektronen-Synchrotron (DESY), Hamburg
+ * \copyright Copyright 2019-2026 Deutsches Elektronen-Synchrotron (DESY), Hamburg
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
@@ -21,18 +21,18 @@
* along with this program. If not, see .
*/
-#ifndef GUL17_BIT_MANIP_H_
-#define GUL17_BIT_MANIP_H_
+#ifndef GUL20_BIT_MANIP_H_
+#define GUL20_BIT_MANIP_H_
#include
#include
-#include "gul17/internal.h"
+#include "gul20/internal.h"
-namespace gul17 {
+namespace GULNS {
/**
- * \addtogroup bit_manip_h gul17/bit_manip.h
+ * \addtogroup bit_manip_h gul20/bit_manip.h
* \brief Bit manipulation and testing, endianness.
* @{
*/
@@ -66,7 +66,7 @@ using BitFunctionReturnType =
* which do not conform to either of these conventions.
*
* \code{.cpp}
- * if constexpr (gul17::endian::native == gul17::endian::big)
+ * if constexpr (GULNS::endian::native == GULNS::endian::big)
* std::cout << "This is a big-endian machine!\n";
* \endcode
*
@@ -232,7 +232,7 @@ bool constexpr inline bit_test(T bits, unsigned bit) noexcept {
* In big-endian order, the most significant byte is stored first, followed by the other
* bytes in order of decreasing significance.
*
- * \see is_little_endian(), gul17::endian
+ * \see is_little_endian(), GULNS::endian
* \since GUL version 2.10
*/
constexpr bool is_big_endian()
@@ -247,7 +247,7 @@ constexpr bool is_big_endian()
* In little-endian order, the least significant byte is stored first, followed by the
* other bytes in order of increasing significance.
*
- * \see is_big_endian(), gul17::endian
+ * \see is_big_endian(), GULNS::endian
* \since GUL version 2.10
*/
constexpr bool is_little_endian()
@@ -257,7 +257,7 @@ constexpr bool is_little_endian()
/// @}
-} // namespace gul17
+} // namespace GULNS
#endif
diff --git a/include/gul17/case_ascii.h b/include/gul20/case_ascii.h
similarity index 94%
rename from include/gul17/case_ascii.h
rename to include/gul20/case_ascii.h
index 84f902b..c1c3f7a 100644
--- a/include/gul17/case_ascii.h
+++ b/include/gul20/case_ascii.h
@@ -5,7 +5,7 @@
* \authors \ref contributors
* \date Created on 28 May 2019
*
- * \copyright Copyright 2019-2024 Deutsches Elektronen-Synchrotron (DESY), Hamburg
+ * \copyright Copyright 2019-2026 Deutsches Elektronen-Synchrotron (DESY), Hamburg
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
@@ -21,18 +21,18 @@
* along with this program. If not, see .
*/
-#ifndef GUL17_CASE_ASCII_H_
-#define GUL17_CASE_ASCII_H_
+#ifndef GUL20_CASE_ASCII_H_
+#define GUL20_CASE_ASCII_H_
#include
#include
-#include "gul17/internal.h"
+#include "gul20/internal.h"
-namespace gul17 {
+namespace GULNS {
/**
- * \addtogroup case_ascii_h gul17/case_ascii.h
+ * \addtogroup case_ascii_h gul20/case_ascii.h
* \brief Converting ASCII characters to lowercase or uppercase.
* @{
*/
@@ -117,7 +117,7 @@ std::string& uppercase_ascii_inplace(std::string& str) noexcept;
/// @}
-} // namespace gul17
+} // namespace GULNS
#endif
diff --git a/include/gul17/cat.h b/include/gul20/cat.h
similarity index 93%
rename from include/gul17/cat.h
rename to include/gul20/cat.h
index 4c92187..9349586 100644
--- a/include/gul17/cat.h
+++ b/include/gul20/cat.h
@@ -5,7 +5,7 @@
* \brief Declaration of the overload set for cat() and of the associated class
* ConvertingStringView.
*
- * \copyright Copyright 2018-2024 Deutsches Elektronen-Synchrotron (DESY), Hamburg
+ * \copyright Copyright 2018-2026 Deutsches Elektronen-Synchrotron (DESY), Hamburg
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
@@ -21,26 +21,26 @@
* along with this program. If not, see .
*/
-#ifndef GUL17_CAT_H_
-#define GUL17_CAT_H_
+#ifndef GUL20_CAT_H_
+#define GUL20_CAT_H_
#include
#include
#include
-#include "gul17/internal.h"
+#include "gul20/internal.h"
-namespace gul17 {
+namespace GULNS {
/**
- * \addtogroup cat_h gul17/cat.h
+ * \addtogroup cat_h gul20/cat.h
* \brief Concatenation of strings and other types.
* @{
*/
/**
* A string view that can automatically convert numbers into strings.
- * This class is primarily intended for use as a parameter in gul17::cat().
+ * This class is primarily intended for use as a parameter in GULNS::cat().
* For string-like arguments, it acts similar to std::string_view. Number-like
* arguments (double, int, ...) are converted into strings in a default format using
* std::to_string. Arguments of type char are converted into a string of length 1.
@@ -88,7 +88,7 @@ class ConvertingStringView
* cat() reserves the correct amount of space before concatenating the strings and can
* therefore save several memory allocations compared to concatenation with "+".
* \code
- * std::string str = gul17::cat(13.5, std::string(" quick "), "brown foxes ", "jump over ",
+ * std::string str = GULNS::cat(13.5, std::string(" quick "), "brown foxes ", "jump over ",
* 42, " lazy dogs'", std::string(" heads."));
* // str == "13.500000 quick brown foxes jump over 42 lazy dogs' heads."
* \endcode
@@ -121,6 +121,6 @@ inline std::string cat(const Args&... args)
/// @}
-} // namespace gul17
+} // namespace GULNS
#endif
diff --git a/include/gul17/date.h b/include/gul20/date.h
similarity index 95%
rename from include/gul17/date.h
rename to include/gul20/date.h
index 6dc06a7..7736480 100644
--- a/include/gul17/date.h
+++ b/include/gul20/date.h
@@ -37,8 +37,8 @@
* We did not mean to shout.
*/
-#ifndef GUL17_DATE_H_
-#define GUL17_DATE_H_
+#ifndef GUL20_DATE_H_
+#define GUL20_DATE_H_
#include
#include
@@ -84,7 +84,7 @@
# pragma warning(disable : 4127)
#endif
-namespace gul17 {
+namespace GULNS {
namespace date {
//---------------+
@@ -441,9 +441,9 @@ class weekday_indexed
public:
weekday_indexed() = default;
- constexpr weekday_indexed(const gul17::date::weekday& wd, unsigned index) noexcept;
+ constexpr weekday_indexed(const GULNS::date::weekday& wd, unsigned index) noexcept;
- constexpr gul17::date::weekday weekday() const noexcept;
+ constexpr GULNS::date::weekday weekday() const noexcept;
constexpr unsigned index() const noexcept;
constexpr bool ok() const noexcept;
};
@@ -459,12 +459,12 @@ operator<<(std::basic_ostream& os, const weekday_indexed& wdi);
class weekday_last
{
- gul17::date::weekday wd_;
+ GULNS::date::weekday wd_;
public:
- explicit constexpr weekday_last(const gul17::date::weekday& wd) noexcept;
+ explicit constexpr weekday_last(const GULNS::date::weekday& wd) noexcept;
- constexpr gul17::date::weekday weekday() const noexcept;
+ constexpr GULNS::date::weekday weekday() const noexcept;
constexpr bool ok() const noexcept;
};
@@ -486,15 +486,15 @@ struct unspecified_month_disambiguator {};
class year_month
{
- gul17::date::year y_;
- gul17::date::month m_;
+ GULNS::date::year y_;
+ GULNS::date::month m_;
public:
year_month() = default;
- constexpr year_month(const gul17::date::year& y, const gul17::date::month& m) noexcept;
+ constexpr year_month(const GULNS::date::year& y, const GULNS::date::month& m) noexcept;
- constexpr gul17::date::year year() const noexcept;
- constexpr gul17::date::month month() const noexcept;
+ constexpr GULNS::date::year year() const noexcept;
+ constexpr GULNS::date::month month() const noexcept;
template
constexpr year_month& operator+=(const months& dm) noexcept;
@@ -533,15 +533,15 @@ operator<<(std::basic_ostream& os, const year_month& ym);
class month_day
{
- gul17::date::month m_;
- gul17::date::day d_;
+ GULNS::date::month m_;
+ GULNS::date::day d_;
public:
month_day() = default;
- constexpr month_day(const gul17::date::month& m, const gul17::date::day& d) noexcept;
+ constexpr month_day(const GULNS::date::month& m, const GULNS::date::day& d) noexcept;
- constexpr gul17::date::month month() const noexcept;
- constexpr gul17::date::day day() const noexcept;
+ constexpr GULNS::date::month month() const noexcept;
+ constexpr GULNS::date::day day() const noexcept;
constexpr bool ok() const noexcept;
};
@@ -561,12 +561,12 @@ operator<<(std::basic_ostream& os, const month_day& md);
class month_day_last
{
- gul17::date::month m_;
+ GULNS::date::month m_;
public:
- constexpr explicit month_day_last(const gul17::date::month& m) noexcept;
+ constexpr explicit month_day_last(const GULNS::date::month& m) noexcept;
- constexpr gul17::date::month month() const noexcept;
+ constexpr GULNS::date::month month() const noexcept;
constexpr bool ok() const noexcept;
};
@@ -585,14 +585,14 @@ operator<<(std::basic_ostream& os, const month_day_last& mdl);
class month_weekday
{
- gul17::date::month m_;
- gul17::date::weekday_indexed wdi_;
+ GULNS::date::month m_;
+ GULNS::date::weekday_indexed wdi_;
public:
- constexpr month_weekday(const gul17::date::month& m,
- const gul17::date::weekday_indexed& wdi) noexcept;
+ constexpr month_weekday(const GULNS::date::month& m,
+ const GULNS::date::weekday_indexed& wdi) noexcept;
- constexpr gul17::date::month month() const noexcept;
- constexpr gul17::date::weekday_indexed weekday_indexed() const noexcept;
+ constexpr GULNS::date::month month() const noexcept;
+ constexpr GULNS::date::weekday_indexed weekday_indexed() const noexcept;
constexpr bool ok() const noexcept;
};
@@ -608,15 +608,15 @@ operator<<(std::basic_ostream& os, const month_weekday& mwd);
class month_weekday_last
{
- gul17::date::month m_;
- gul17::date::weekday_last wdl_;
+ GULNS::date::month m_;
+ GULNS::date::weekday_last wdl_;
public:
- constexpr month_weekday_last(const gul17::date::month& m,
- const gul17::date::weekday_last& wd) noexcept;
+ constexpr month_weekday_last(const GULNS::date::month& m,
+ const GULNS::date::weekday_last& wd) noexcept;
- constexpr gul17::date::month month() const noexcept;
- constexpr gul17::date::weekday_last weekday_last() const noexcept;
+ constexpr GULNS::date::month month() const noexcept;
+ constexpr GULNS::date::weekday_last weekday_last() const noexcept;
constexpr bool ok() const noexcept;
};
@@ -634,14 +634,14 @@ operator<<(std::basic_ostream& os, const month_weekday_last& mwdl
class year_month_day
{
- gul17::date::year y_;
- gul17::date::month m_;
- gul17::date::day d_;
+ GULNS::date::year y_;
+ GULNS::date::month m_;
+ GULNS::date::day d_;
public:
year_month_day() = default;
- constexpr year_month_day(const gul17::date::year& y, const gul17::date::month& m,
- const gul17::date::day& d) noexcept;
+ constexpr year_month_day(const GULNS::date::year& y, const GULNS::date::month& m,
+ const GULNS::date::day& d) noexcept;
constexpr year_month_day(const year_month_day_last& ymdl) noexcept;
constexpr year_month_day(sys_days dp) noexcept;
@@ -654,9 +654,9 @@ class year_month_day
constexpr year_month_day& operator+=(const years& y) noexcept;
constexpr year_month_day& operator-=(const years& y) noexcept;
- constexpr gul17::date::year year() const noexcept;
- constexpr gul17::date::month month() const noexcept;
- constexpr gul17::date::day day() const noexcept;
+ constexpr GULNS::date::year year() const noexcept;
+ constexpr GULNS::date::month month() const noexcept;
+ constexpr GULNS::date::day day() const noexcept;
constexpr operator sys_days() const noexcept;
constexpr explicit operator local_days() const noexcept;
@@ -692,12 +692,12 @@ operator<<(std::basic_ostream& os, const year_month_day& ymd);
class year_month_day_last
{
- gul17::date::year y_;
- gul17::date::month_day_last mdl_;
+ GULNS::date::year y_;
+ GULNS::date::month_day_last mdl_;
public:
- constexpr year_month_day_last(const gul17::date::year& y,
- const gul17::date::month_day_last& mdl) noexcept;
+ constexpr year_month_day_last(const GULNS::date::year& y,
+ const GULNS::date::month_day_last& mdl) noexcept;
template
constexpr year_month_day_last& operator+=(const months& m) noexcept;
@@ -706,10 +706,10 @@ class year_month_day_last
constexpr year_month_day_last& operator+=(const years& y) noexcept;
constexpr year_month_day_last& operator-=(const years& y) noexcept;
- constexpr gul17::date::year year() const noexcept;
- constexpr gul17::date::month month() const noexcept;
- constexpr gul17::date::month_day_last month_day_last() const noexcept;
- constexpr gul17::date::day day() const noexcept;
+ constexpr GULNS::date::year year() const noexcept;
+ constexpr GULNS::date::month month() const noexcept;
+ constexpr GULNS::date::month_day_last month_day_last() const noexcept;
+ constexpr GULNS::date::day day() const noexcept;
constexpr operator sys_days() const noexcept;
constexpr explicit operator local_days() const noexcept;
@@ -764,14 +764,14 @@ operator<<(std::basic_ostream& os, const year_month_day_last& ymd
class year_month_weekday
{
- gul17::date::year y_;
- gul17::date::month m_;
- gul17::date::weekday_indexed wdi_;
+ GULNS::date::year y_;
+ GULNS::date::month m_;
+ GULNS::date::weekday_indexed wdi_;
public:
year_month_weekday() = default;
- constexpr year_month_weekday(const gul17::date::year& y, const gul17::date::month& m,
- const gul17::date::weekday_indexed& wdi) noexcept;
+ constexpr year_month_weekday(const GULNS::date::year& y, const GULNS::date::month& m,
+ const GULNS::date::weekday_indexed& wdi) noexcept;
constexpr year_month_weekday(const sys_days& dp) noexcept;
constexpr explicit year_month_weekday(const local_days& dp) noexcept;
@@ -782,11 +782,11 @@ class year_month_weekday
constexpr year_month_weekday& operator+=(const years& y) noexcept;
constexpr year_month_weekday& operator-=(const years& y) noexcept;
- constexpr gul17::date::year year() const noexcept;
- constexpr gul17::date::month month() const noexcept;
- constexpr gul17::date::weekday weekday() const noexcept;
+ constexpr GULNS::date::year year() const noexcept;
+ constexpr GULNS::date::month month() const noexcept;
+ constexpr GULNS::date::weekday weekday() const noexcept;
constexpr unsigned index() const noexcept;
- constexpr gul17::date::weekday_indexed weekday_indexed() const noexcept;
+ constexpr GULNS::date::weekday_indexed weekday_indexed() const noexcept;
constexpr operator sys_days() const noexcept;
constexpr explicit operator local_days() const noexcept;
@@ -837,13 +837,13 @@ operator<<(std::basic_ostream& os, const year_month_weekday& ymwd
class year_month_weekday_last
{
- gul17::date::year y_;
- gul17::date::month m_;
- gul17::date::weekday_last wdl_;
+ GULNS::date::year y_;
+ GULNS::date::month m_;
+ GULNS::date::weekday_last wdl_;
public:
- constexpr year_month_weekday_last(const gul17::date::year& y, const gul17::date::month& m,
- const gul17::date::weekday_last& wdl) noexcept;
+ constexpr year_month_weekday_last(const GULNS::date::year& y, const GULNS::date::month& m,
+ const GULNS::date::weekday_last& wdl) noexcept;
template
constexpr year_month_weekday_last& operator+=(const months& m) noexcept;
@@ -852,10 +852,10 @@ class year_month_weekday_last
constexpr year_month_weekday_last& operator+=(const years& y) noexcept;
constexpr year_month_weekday_last& operator-=(const years& y) noexcept;
- constexpr gul17::date::year year() const noexcept;
- constexpr gul17::date::month month() const noexcept;
- constexpr gul17::date::weekday weekday() const noexcept;
- constexpr gul17::date::weekday_last weekday_last() const noexcept;
+ constexpr GULNS::date::year year() const noexcept;
+ constexpr GULNS::date::month month() const noexcept;
+ constexpr GULNS::date::weekday weekday() const noexcept;
+ constexpr GULNS::date::weekday_last weekday_last() const noexcept;
constexpr operator sys_days() const noexcept;
constexpr explicit operator local_days() const noexcept;
@@ -908,32 +908,32 @@ operator<<(std::basic_ostream& os, const year_month_weekday_last&
inline namespace literals
{
-constexpr gul17::date::day operator ""_d(unsigned long long d) noexcept;
-constexpr gul17::date::year operator ""_y(unsigned long long y) noexcept;
+constexpr GULNS::date::day operator ""_d(unsigned long long d) noexcept;
+constexpr GULNS::date::year operator ""_y(unsigned long long y) noexcept;
} // inline namespace literals
#endif // !defined(_MSC_VER) || (_MSC_VER >= 1900)
-// constexpr const gul17::date::month January{1};
-// constexpr const gul17::date::month February{2};
-// constexpr const gul17::date::month March{3};
-// constexpr const gul17::date::month April{4};
-// constexpr const gul17::date::month May{5};
-// constexpr const gul17::date::month June{6};
-// constexpr const gul17::date::month July{7};
-// constexpr const gul17::date::month August{8};
-// constexpr const gul17::date::month September{9};
-// constexpr const gul17::date::month October{10};
-// constexpr const gul17::date::month November{11};
-// constexpr const gul17::date::month December{12};
+// constexpr const GULNS::date::month January{1};
+// constexpr const GULNS::date::month February{2};
+// constexpr const GULNS::date::month March{3};
+// constexpr const GULNS::date::month April{4};
+// constexpr const GULNS::date::month May{5};
+// constexpr const GULNS::date::month June{6};
+// constexpr const GULNS::date::month July{7};
+// constexpr const GULNS::date::month August{8};
+// constexpr const GULNS::date::month September{9};
+// constexpr const GULNS::date::month October{10};
+// constexpr const GULNS::date::month November{11};
+// constexpr const GULNS::date::month December{12};
//
-// constexpr const gul17::date::weekday Sunday{0u};
-// constexpr const gul17::date::weekday Monday{1u};
-// constexpr const gul17::date::weekday Tuesday{2u};
-// constexpr const gul17::date::weekday Wednesday{3u};
-// constexpr const gul17::date::weekday Thursday{4u};
-// constexpr const gul17::date::weekday Friday{5u};
-// constexpr const gul17::date::weekday Saturday{6u};
+// constexpr const GULNS::date::weekday Sunday{0u};
+// constexpr const GULNS::date::weekday Monday{1u};
+// constexpr const GULNS::date::weekday Tuesday{2u};
+// constexpr const GULNS::date::weekday Wednesday{3u};
+// constexpr const GULNS::date::weekday Thursday{4u};
+// constexpr const GULNS::date::weekday Friday{5u};
+// constexpr const GULNS::date::weekday Saturday{6u};
#if HAS_VOID_T
@@ -1263,7 +1263,7 @@ std::chrono::time_point
floor(const std::chrono::time_point& tp)
{
using std::chrono::time_point;
- return time_point{gul17::date::floor(tp.time_since_epoch())};
+ return time_point{GULNS::date::floor(tp.time_since_epoch())};
}
// round to nearest, to even on tie
@@ -1808,67 +1808,67 @@ inline namespace literals
{
constexpr inline
-gul17::date::day
+GULNS::date::day
operator ""_d(unsigned long long d) noexcept
{
- return gul17::date::day{static_cast(d)};
+ return GULNS::date::day{static_cast(d)};
}
constexpr inline
-gul17::date::year
+GULNS::date::year
operator ""_y(unsigned long long y) noexcept
{
- return gul17::date::year(static_cast(y));
+ return GULNS::date::year(static_cast(y));
}
#endif // !defined(_MSC_VER) || (_MSC_VER >= 1900)
-constexpr const gul17::date::last_spec last{};
-
-constexpr const gul17::date::month jan{1};
-constexpr const gul17::date::month feb{2};
-constexpr const gul17::date::month mar{3};
-constexpr const gul17::date::month apr{4};
-constexpr const gul17::date::month may{5};
-constexpr const gul17::date::month jun{6};
-constexpr const gul17::date::month jul{7};
-constexpr const gul17::date::month aug{8};
-constexpr const gul17::date::month sep{9};
-constexpr const gul17::date::month oct{10};
-constexpr const gul17::date::month nov{11};
-constexpr const gul17::date::month dec{12};
-
-constexpr const gul17::date::weekday sun{0u};
-constexpr const gul17::date::weekday mon{1u};
-constexpr const gul17::date::weekday tue{2u};
-constexpr const gul17::date::weekday wed{3u};
-constexpr const gul17::date::weekday thu{4u};
-constexpr const gul17::date::weekday fri{5u};
-constexpr const gul17::date::weekday sat{6u};
+constexpr const GULNS::date::last_spec last{};
+
+constexpr const GULNS::date::month jan{1};
+constexpr const GULNS::date::month feb{2};
+constexpr const GULNS::date::month mar{3};
+constexpr const GULNS::date::month apr{4};
+constexpr const GULNS::date::month may{5};
+constexpr const GULNS::date::month jun{6};
+constexpr const GULNS::date::month jul{7};
+constexpr const GULNS::date::month aug{8};
+constexpr const GULNS::date::month sep{9};
+constexpr const GULNS::date::month oct{10};
+constexpr const GULNS::date::month nov{11};
+constexpr const GULNS::date::month dec{12};
+
+constexpr const GULNS::date::weekday sun{0u};
+constexpr const GULNS::date::weekday mon{1u};
+constexpr const GULNS::date::weekday tue{2u};
+constexpr const GULNS::date::weekday wed{3u};
+constexpr const GULNS::date::weekday thu{4u};
+constexpr const GULNS::date::weekday fri{5u};
+constexpr const GULNS::date::weekday sat{6u};
#if !defined(_MSC_VER) || (_MSC_VER >= 1900)
} // inline namespace literals
#endif
-constexpr const gul17::date::month January{1};
-constexpr const gul17::date::month February{2};
-constexpr const gul17::date::month March{3};
-constexpr const gul17::date::month April{4};
-constexpr const gul17::date::month May{5};
-constexpr const gul17::date::month June{6};
-constexpr const gul17::date::month July{7};
-constexpr const gul17::date::month August{8};
-constexpr const gul17::date::month September{9};
-constexpr const gul17::date::month October{10};
-constexpr const gul17::date::month November{11};
-constexpr const gul17::date::month December{12};
-
-constexpr const gul17::date::weekday Monday{1};
-constexpr const gul17::date::weekday Tuesday{2};
-constexpr const gul17::date::weekday Wednesday{3};
-constexpr const gul17::date::weekday Thursday{4};
-constexpr const gul17::date::weekday Friday{5};
-constexpr const gul17::date::weekday Saturday{6};
-constexpr const gul17::date::weekday Sunday{7};
+constexpr const GULNS::date::month January{1};
+constexpr const GULNS::date::month February{2};
+constexpr const GULNS::date::month March{3};
+constexpr const GULNS::date::month April{4};
+constexpr const GULNS::date::month May{5};
+constexpr const GULNS::date::month June{6};
+constexpr const GULNS::date::month July{7};
+constexpr const GULNS::date::month August{8};
+constexpr const GULNS::date::month September{9};
+constexpr const GULNS::date::month October{10};
+constexpr const GULNS::date::month November{11};
+constexpr const GULNS::date::month December{12};
+
+constexpr const GULNS::date::weekday Monday{1};
+constexpr const GULNS::date::weekday Tuesday{2};
+constexpr const GULNS::date::weekday Wednesday{3};
+constexpr const GULNS::date::weekday Thursday{4};
+constexpr const GULNS::date::weekday Friday{5};
+constexpr const GULNS::date::weekday Saturday{6};
+constexpr const GULNS::date::weekday Sunday{7};
// weekday_indexed
@@ -1876,7 +1876,7 @@ constexpr inline
weekday
weekday_indexed::weekday() const noexcept
{
- return gul17::date::weekday{static_cast(wd_)};
+ return GULNS::date::weekday{static_cast(wd_)};
}
constexpr inline unsigned weekday_indexed::index() const noexcept {return index_;}
@@ -1893,7 +1893,7 @@ weekday_indexed::ok() const noexcept
#endif // __GNUC__
constexpr inline
-weekday_indexed::weekday_indexed(const gul17::date::weekday& wd, unsigned index) noexcept
+weekday_indexed::weekday_indexed(const GULNS::date::weekday& wd, unsigned index) noexcept
: wd_(static_cast(static_cast(wd.wd_)))
, index_(static_cast(index))
{}
@@ -1945,9 +1945,9 @@ operator!=(const weekday_indexed& x, const weekday_indexed& y) noexcept
// weekday_last
-constexpr inline gul17::date::weekday weekday_last::weekday() const noexcept {return wd_;}
+constexpr inline GULNS::date::weekday weekday_last::weekday() const noexcept {return wd_;}
constexpr inline bool weekday_last::ok() const noexcept {return wd_.ok();}
-constexpr inline weekday_last::weekday_last(const gul17::date::weekday& wd) noexcept : wd_(wd) {}
+constexpr inline weekday_last::weekday_last(const GULNS::date::weekday& wd) noexcept : wd_(wd) {}
constexpr inline bool
operator==(const weekday_last& x, const weekday_last& y) noexcept
@@ -1994,7 +1994,7 @@ weekday::operator[](last_spec) const noexcept
// year_month
constexpr inline
-year_month::year_month(const gul17::date::year& y, const gul17::date::month& m) noexcept
+year_month::year_month(const GULNS::date::year& y, const GULNS::date::month& m) noexcept
: y_(y)
, m_(m)
{}
@@ -2147,25 +2147,25 @@ operator<<(std::basic_ostream& os, const year_month& ym)
// month_day
constexpr inline
-month_day::month_day(const gul17::date::month& m, const gul17::date::day& d) noexcept
+month_day::month_day(const GULNS::date::month& m, const GULNS::date::day& d) noexcept
: m_(m)
, d_(d)
{}
-constexpr inline gul17::date::month month_day::month() const noexcept {return m_;}
-constexpr inline gul17::date::day month_day::day() const noexcept {return d_;}
+constexpr inline GULNS::date::month month_day::month() const noexcept {return m_;}
+constexpr inline GULNS::date::day month_day::day() const noexcept {return d_;}
constexpr inline bool
month_day::ok() const noexcept
{
- constexpr const gul17::date::day d[] =
+ constexpr const GULNS::date::day d[] =
{
- gul17::date::day(31), gul17::date::day(29), gul17::date::day(31),
- gul17::date::day(30), gul17::date::day(31), gul17::date::day(30),
- gul17::date::day(31), gul17::date::day(31), gul17::date::day(30),
- gul17::date::day(31), gul17::date::day(30), gul17::date::day(31)
+ GULNS::date::day(31), GULNS::date::day(29), GULNS::date::day(31),
+ GULNS::date::day(30), GULNS::date::day(31), GULNS::date::day(30),
+ GULNS::date::day(31), GULNS::date::day(31), GULNS::date::day(30),
+ GULNS::date::day(31), GULNS::date::day(30), GULNS::date::day(31)
};
- return m_.ok() && gul17::date::day{1} <= d_ && d_ <= d[static_cast(m_)-1];
+ return m_.ok() && GULNS::date::day{1} <= d_ && d_ <= d[static_cast(m_)-1];
}
constexpr inline bool
@@ -2234,7 +2234,7 @@ operator<<(std::basic_ostream& os, const month_day& md)
constexpr inline month month_day_last::month() const noexcept {return m_;}
constexpr inline bool month_day_last::ok() const noexcept {return m_.ok();}
-constexpr inline month_day_last::month_day_last(const gul17::date::month& m) noexcept : m_(m) {}
+constexpr inline month_day_last::month_day_last(const GULNS::date::month& m) noexcept : m_(m) {}
constexpr inline bool
operator==(const month_day_last& x, const month_day_last& y) noexcept
@@ -2298,8 +2298,8 @@ operator<<(std::basic_ostream& os, const month_day_last& mdl)
// month_weekday
constexpr inline
-month_weekday::month_weekday(const gul17::date::month& m,
- const gul17::date::weekday_indexed& wdi) noexcept
+month_weekday::month_weekday(const GULNS::date::month& m,
+ const GULNS::date::weekday_indexed& wdi) noexcept
: m_(m)
, wdi_(wdi)
{}
@@ -2357,8 +2357,8 @@ operator<<(std::basic_ostream& os, const month_weekday& mwd)
// month_weekday_last
constexpr inline
-month_weekday_last::month_weekday_last(const gul17::date::month& m,
- const gul17::date::weekday_last& wdl) noexcept
+month_weekday_last::month_weekday_last(const GULNS::date::month& m,
+ const GULNS::date::weekday_last& wdl) noexcept
: m_(m)
, wdl_(wdl)
{}
@@ -2415,8 +2415,8 @@ operator<<(std::basic_ostream& os, const month_weekday_last& mwdl
// year_month_day_last
-constexpr inline year_month_day_last::year_month_day_last(const gul17::date::year& y,
- const gul17::date::month_day_last& mdl) noexcept
+constexpr inline year_month_day_last::year_month_day_last(const GULNS::date::year& y,
+ const GULNS::date::month_day_last& mdl) noexcept
: y_(y)
, mdl_(mdl)
{}
@@ -2465,15 +2465,15 @@ constexpr inline
day
year_month_day_last::day() const noexcept
{
- constexpr const gul17::date::day d[] =
+ constexpr const GULNS::date::day d[] =
{
- gul17::date::day(31), gul17::date::day(28), gul17::date::day(31),
- gul17::date::day(30), gul17::date::day(31), gul17::date::day(30),
- gul17::date::day(31), gul17::date::day(31), gul17::date::day(30),
- gul17::date::day(31), gul17::date::day(30), gul17::date::day(31)
+ GULNS::date::day(31), GULNS::date::day(28), GULNS::date::day(31),
+ GULNS::date::day(30), GULNS::date::day(31), GULNS::date::day(30),
+ GULNS::date::day(31), GULNS::date::day(31), GULNS::date::day(30),
+ GULNS::date::day(31), GULNS::date::day(30), GULNS::date::day(31)
};
return (month() != February || !y_.is_leap()) && mdl_.ok() ?
- d[static_cast(month()) - 1] : gul17::date::day{29};
+ d[static_cast(month()) - 1] : GULNS::date::day{29};
}
constexpr inline
@@ -2604,8 +2604,8 @@ operator-(const year_month_day_last& ymdl, const years& dy) noexcept
// year_month_day
constexpr inline
-year_month_day::year_month_day(const gul17::date::year& y, const gul17::date::month& m,
- const gul17::date::day& d) noexcept
+year_month_day::year_month_day(const GULNS::date::year& y, const GULNS::date::month& m,
+ const GULNS::date::day& d) noexcept
: y_(y)
, m_(m)
, d_(d)
@@ -2701,7 +2701,7 @@ year_month_day::ok() const noexcept
{
if (!(y_.ok() && m_.ok()))
return false;
- return gul17::date::day{1} <= d_ && d_ <= (y_ / m_ / last).day();
+ return GULNS::date::day{1} <= d_ && d_ <= (y_ / m_ / last).day();
}
constexpr inline bool
@@ -2780,7 +2780,7 @@ year_month_day::from_days(days dp) noexcept
auto const mp = (5*doy + 2)/153; // [0, 11]
auto const d = doy - (153*mp+2)/5 + 1; // [1, 31]
auto const m = mp < 10 ? mp+3 : mp-9; // [1, 12]
- return year_month_day{gul17::date::year{y + (m <= 2)}, gul17::date::month(m), gul17::date::day(d)};
+ return year_month_day{GULNS::date::year{y + (m <= 2)}, GULNS::date::month(m), GULNS::date::day(d)};
}
template
@@ -2831,8 +2831,8 @@ operator-(const year_month_day& ymd, const years& dy) noexcept
// year_month_weekday
constexpr inline
-year_month_weekday::year_month_weekday(const gul17::date::year& y, const gul17::date::month& m,
- const gul17::date::weekday_indexed& wdi)
+year_month_weekday::year_month_weekday(const GULNS::date::year& y, const GULNS::date::month& m,
+ const GULNS::date::weekday_indexed& wdi)
noexcept
: y_(y)
, m_(m)
@@ -2926,7 +2926,7 @@ year_month_weekday::ok() const noexcept
return false;
if (wdi_.index() <= 4)
return true;
- auto d2 = wdi_.weekday() - gul17::date::weekday(static_cast(y_/m_/1)) +
+ auto d2 = wdi_.weekday() - GULNS::date::weekday(static_cast(y_/m_/1)) +
days((wdi_.index()-1)*7 + 1);
return static_cast(d2.count()) <= static_cast((y_/m_/last).day());
}
@@ -2936,7 +2936,7 @@ year_month_weekday
year_month_weekday::from_days(days d) noexcept
{
sys_days dp{d};
- auto const wd = gul17::date::weekday(dp);
+ auto const wd = GULNS::date::weekday(dp);
auto const ymd = year_month_day(dp);
return {ymd.year(), ymd.month(), wd[(static_cast(ymd.day())-1)/7+1]};
}
@@ -2946,7 +2946,7 @@ days
year_month_weekday::to_days() const noexcept
{
auto d = sys_days(y_/m_/1);
- return (d + (wdi_.weekday() - gul17::date::weekday(d) + days{(wdi_.index()-1)*7})
+ return (d + (wdi_.weekday() - GULNS::date::weekday(d) + days{(wdi_.index()-1)*7})
).time_since_epoch();
}
@@ -3024,9 +3024,9 @@ operator-(const year_month_weekday& ymwd, const years& dy) noexcept
// year_month_weekday_last
constexpr inline
-year_month_weekday_last::year_month_weekday_last(const gul17::date::year& y,
- const gul17::date::month& m,
- const gul17::date::weekday_last& wdl) noexcept
+year_month_weekday_last::year_month_weekday_last(const GULNS::date::year& y,
+ const GULNS::date::month& m,
+ const GULNS::date::weekday_last& wdl) noexcept
: y_(y)
, m_(m)
, wdl_(wdl)
@@ -3106,7 +3106,7 @@ days
year_month_weekday_last::to_days() const noexcept
{
auto const d = sys_days(y_/m_/last);
- return (d - (gul17::date::weekday{d} - wdl_.weekday())).time_since_epoch();
+ return (d - (GULNS::date::weekday{d} - wdl_.weekday())).time_since_epoch();
}
constexpr inline bool
@@ -3586,7 +3586,7 @@ class decimal_format_seconds
std::basic_ostream&
print(std::basic_ostream& os, std::true_type) const
{
- gul17::date::detail::save_ostream _(os);
+ GULNS::date::detail::save_ostream _(os);
std::chrono::duration d = s_ + sub_s_;
if (d < std::chrono::seconds{10})
os << '0';
@@ -3599,7 +3599,7 @@ class decimal_format_seconds
std::basic_ostream&
print(std::basic_ostream& os, std::false_type) const
{
- gul17::date::detail::save_ostream _(os);
+ GULNS::date::detail::save_ostream _(os);
os.fill('0');
os.flags(std::ios::dec | std::ios::right);
os.width(2);
@@ -3611,7 +3611,7 @@ class decimal_format_seconds
#else
os << '.';
#endif
- gul17::date::detail::save_ostream _s(os);
+ GULNS::date::detail::save_ostream _s(os);
os.imbue(std::locale::classic());
os.width(width);
os << sub_s_.count();
@@ -3711,14 +3711,14 @@ class hh_mm_ss
template
friend
std::basic_ostream&
- gul17::date::to_stream(std::basic_ostream& os, const CharT* fmt,
+ GULNS::date::to_stream(std::basic_ostream& os, const CharT* fmt,
const fields& fds, const std::string* abbrev,
const std::chrono::seconds* offset_sec);
template
friend
std::basic_istream&
- gul17::date::from_stream(std::basic_istream& is, const CharT* fmt,
+ GULNS::date::from_stream(std::basic_istream& is, const CharT* fmt,
fields& fds,
std::basic_string* abbrev, std::chrono::minutes* offset);
};
@@ -3788,7 +3788,7 @@ typename std::enable_if
>::type
operator<<(std::basic_ostream& os, const sys_time& tp)
{
- auto const dp = gul17::date::floor(tp);
+ auto const dp = GULNS::date::floor(tp);
return os << year_month_day(dp) << ' ' << make_time(tp-dp);
}
@@ -4602,7 +4602,7 @@ to_stream(std::basic_ostream& os, const CharT* fmt,
using std::chrono::seconds;
using std::chrono::minutes;
using std::chrono::hours;
- gul17::date::detail::save_ostream ss(os);
+ GULNS::date::detail::save_ostream ss(os);
os.fill(' ');
os.flags(std::ios::skipws | std::ios::dec);
os.width(0);
@@ -4934,7 +4934,7 @@ to_stream(std::basic_ostream& os, const CharT* fmt,
if (modified == CharT{})
#endif
{
- auto h = *fmt == CharT{'I'} ? gul17::date::make12(hms.hours()) : hms.hours();
+ auto h = *fmt == CharT{'I'} ? GULNS::date::make12(hms.hours()) : hms.hours();
if (h < hours{10})
os << CharT{'0'};
os << h.count();
@@ -5090,7 +5090,7 @@ to_stream(std::basic_ostream& os, const CharT* fmt,
tm.tm_hour = static_cast(fds.tod.hours().count());
facet.put(os, os, os.fill(), &tm, std::begin(f), std::end(f));
#else
- if (gul17::date::is_am(fds.tod.hours()))
+ if (GULNS::date::is_am(fds.tod.hours()))
os << ampm_names().first[0];
else
os << ampm_names().first[1];
@@ -5148,12 +5148,12 @@ to_stream(std::basic_ostream& os, const CharT* fmt,
save_ostream _(os);
os.fill('0');
os.width(2);
- os << gul17::date::make12(tod.hours()).count() << CharT{':'};
+ os << GULNS::date::make12(tod.hours()).count() << CharT{':'};
os.width(2);
os << tod.minutes().count() << CharT{':'};
os.width(2);
os << tod.seconds().count() << CharT{' '};
- if (gul17::date::is_am(tod.hours()))
+ if (GULNS::date::is_am(tod.hours()))
os << ampm_names().first[0];
else
os << ampm_names().first[1];
@@ -5564,7 +5564,7 @@ to_stream(std::basic_ostream& os, const CharT* fmt,
}
auto m = duration_cast(*offset_sec);
auto neg = m < minutes{0};
- m = gul17::date::abs(m);
+ m = GULNS::date::abs(m);
auto h = duration_cast(m);
m -= h;
if (neg)
@@ -6120,7 +6120,7 @@ from_stream(std::basic_istream& is, const CharT* fmt,
typename std::basic_istream::sentry ok{is, true};
if (ok)
{
- gul17::date::detail::save_istream ss(is);
+ GULNS::date::detail::save_istream ss(is);
is.fill(' ');
is.flags(std::ios::skipws | std::ios::dec);
is.width(0);
@@ -7449,7 +7449,7 @@ from_stream(std::basic_istream& is, const CharT* fmt, year& y,
{
using CT = std::chrono::seconds;
fields fds{};
- gul17::date::from_stream(is, fmt, fds, abbrev, offset);
+ GULNS::date::from_stream(is, fmt, fds, abbrev, offset);
if (!fds.ymd.year().ok())
is.setstate(std::ios::failbit);
if (!is.fail())
@@ -7465,7 +7465,7 @@ from_stream(std::basic_istream& is, const CharT* fmt, month& m,
{
using CT = std::chrono::seconds;
fields fds{};
- gul17::date::from_stream(is, fmt, fds, abbrev, offset);
+ GULNS::date::from_stream(is, fmt, fds, abbrev, offset);
if (!fds.ymd.month().ok())
is.setstate(std::ios::failbit);
if (!is.fail())
@@ -7481,7 +7481,7 @@ from_stream(std::basic_istream& is, const CharT* fmt, day& d,
{
using CT = std::chrono::seconds;
fields fds{};
- gul17::date::from_stream(is, fmt, fds, abbrev, offset);
+ GULNS::date::from_stream(is, fmt, fds, abbrev, offset);
if (!fds.ymd.day().ok())
is.setstate(std::ios::failbit);
if (!is.fail())
@@ -7497,7 +7497,7 @@ from_stream(std::basic_istream& is, const CharT* fmt, weekday& wd
{
using CT = std::chrono::seconds;
fields fds{};
- gul17::date::from_stream(is, fmt, fds, abbrev, offset);
+ GULNS::date::from_stream(is, fmt, fds, abbrev, offset);
if (!fds.wd.ok())
is.setstate(std::ios::failbit);
if (!is.fail())
@@ -7513,7 +7513,7 @@ from_stream(std::basic_istream& is, const CharT* fmt, year_month&
{
using CT = std::chrono::seconds;
fields fds{};
- gul17::date::from_stream(is, fmt, fds, abbrev, offset);
+ GULNS::date::from_stream(is, fmt, fds, abbrev, offset);
if (!fds.ymd.month().ok())
is.setstate(std::ios::failbit);
if (!is.fail())
@@ -7529,7 +7529,7 @@ from_stream(std::basic_istream& is, const CharT* fmt, month_day&
{
using CT = std::chrono::seconds;
fields fds{};
- gul17::date::from_stream(is, fmt, fds, abbrev, offset);
+ GULNS::date::from_stream(is, fmt, fds, abbrev, offset);
if (!fds.ymd.month().ok() || !fds.ymd.day().ok())
is.setstate(std::ios::failbit);
if (!is.fail())
@@ -7545,7 +7545,7 @@ from_stream(std::basic_istream& is, const CharT* fmt,
{
using CT = std::chrono::seconds;
fields fds{};
- gul17::date::from_stream(is, fmt, fds, abbrev, offset);
+ GULNS::date::from_stream(is, fmt, fds, abbrev, offset);
if (!fds.ymd.ok())
is.setstate(std::ios::failbit);
if (!is.fail())
@@ -7565,7 +7565,7 @@ from_stream(std::basic_istream