Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ jobs:
uses: boostorg/boost-ci/.github/workflows/reusable.yml@master
with:
exclude_compiler: 'clang-3.5,clang-3.6,clang-3.7,clang-3.8,clang-3.9,clang-4.0,clang-5.0,clang-6.0,clang-7,
clang-8,clang-9,clang-10,clang-11,clang-12,clang-13,clang-14,clang-15,clang-16,
gcc-4.7,gcc-4.8,gcc-4.9,gcc-5,gcc-6,gcc-7,gcc-8,gcc-9,gcc-10,gcc-11,gcc-12'
clang-8,clang-9,clang-10,
gcc-4.7,gcc-4.8,gcc-4.9,gcc-5,gcc-6,gcc-7,gcc-8'
# Example of customization:
# with:
# enable_reflection: true
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ A safe and fully featured replacement for C++ builtin numeric types.

This library requires C++20 and is tested on the following platforms:

* GCC 13 and later
* Clang 17 and later
* GCC 9 and later
* Clang 11 and later
* Visual Studio 2022 and later
* Intel OneAPI DPC++
4 changes: 2 additions & 2 deletions doc/modules/ROOT/pages/overview.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ Safety critical applications
Boost.safe_numbers is tested natively on Ubuntu (x86_64, x86_32, s390x, aarch64, ARM32v7), macOS (x86_64, and Apple Silicon), and Windows (x86_64, x86_32, and ARM64);
as well as emulated PPC64LE using QEMU with the following compilers:

* GCC 13 and later
* Clang 17 and later
* GCC 9 and later
* Clang 11 and later
* Visual Studio 2022 (14.3) and later
* Intel OneAPI DPC++ 2024.2 and later

Expand Down
11 changes: 11 additions & 0 deletions include/boost/safe_numbers/detail/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,15 @@
# define BOOST_SAFE_NUMBERS_UNREACHABLE std::abort()
#endif

namespace boost::safe_numbers::detail {

// Workaround for static_assert(false, ...) in if constexpr branches.
// Before C++23 (P2593R1), static_assert(false) is ill-formed even in
// discarded branches. Making the condition depend on a template parameter
// defers evaluation until instantiation.
template <typename...>
inline constexpr auto dependent_false {false};

} // namespace boost::safe_numbers::detail

#endif // BOOST_SAFENUMBERS_CONFIG_HPP
2 changes: 1 addition & 1 deletion include/boost/safe_numbers/detail/type_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ struct underlying<unsigned_integer_basis<T>>
} // namespace impl

template <typename T>
using underlying_type_t = impl::underlying<T>::type;
using underlying_type_t = typename impl::underlying<T>::type;

} // namespace boost::safe_numbers::detail

Expand Down
182 changes: 91 additions & 91 deletions include/boost/safe_numbers/detail/unsigned_integer_basis.hpp

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions include/boost/safe_numbers/format.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include <boost/safe_numbers/detail/int128/format.hpp>
#include <boost/safe_numbers/detail/concepts.hpp>

#ifdef BOOST_SAFE_NUMBERS_DETAIL_INT128_HAS_FORMAT

#ifndef BOOST_SAFE_NUMBERS_BUILD_MODULE

#include <format>
Expand All @@ -27,4 +29,6 @@ struct std::formatter<boost::safe_numbers::detail::unsigned_integer_basis<BasisT
}
};

#endif // Has format

#endif // BOOST_SAFE_NUMBERS_FORMAT_HPP
2 changes: 1 addition & 1 deletion test/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ project : requirements
<toolset>clang:<warnings-as-errors>on
<toolset>gcc:<warnings-as-errors>on

[ requires cxx17_hdr_charconv cxx20_hdr_bit cxx20_hdr_compare cxx20_hdr_concepts cxx20_hdr_format ]
[ requires cxx20_hdr_bit cxx20_hdr_compare cxx20_hdr_concepts ]
;

run quick.cpp ;
Expand Down
16 changes: 16 additions & 0 deletions test/test_unsigned_std_format.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,17 @@ import boost.safe_numbers;
#else

#include <boost/safe_numbers.hpp>

#ifdef BOOST_SAFE_NUMBERS_DETAIL_INT128_HAS_FORMAT

#include <format>

#endif

#endif

#ifdef BOOST_SAFE_NUMBERS_DETAIL_INT128_HAS_FORMAT

#include <boost/core/lightweight_test.hpp>

using namespace boost::safe_numbers;
Expand All @@ -37,3 +44,12 @@ int main()

return boost::report_errors();
}

#else

int main()
{
return 0;
}

#endif
Loading