Linux websever 5.15.0-153-generic #163-Ubuntu SMP Thu Aug 7 16:37:18 UTC 2025 x86_64
Apache/2.4.52 (Ubuntu)
: 192.168.3.70 | : 192.168.1.99
Cant Read [ /etc/named.conf ]
8.1.2-1ubuntu2.23
urlab
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
opt /
miniconda3 /
python /
include /
mamba /
util /
[ HOME SHELL ]
Name
Size
Permission
Action
build.hpp
838
B
-rw-rw-r--
cast.hpp
3.46
KB
-rw-rw-r--
compare.hpp
2.06
KB
-rw-rw-r--
deprecation.hpp
612
B
-rw-rw-r--
flat_binary_tree.hpp
7.56
KB
-rw-rw-r--
flat_bool_expr_tree.hpp
16.24
KB
-rw-rw-r--
flat_set.hpp
10.72
KB
-rw-rw-r--
functional.hpp
770
B
-rw-rw-r--
graph.hpp
23.48
KB
-rw-rw-r--
iterator.hpp
13.6
KB
-rw-rw-r--
path_manip.hpp
1.21
KB
-rw-rw-r--
string.hpp
23.76
KB
-rw-rw-r--
type_traits.hpp
1.45
KB
-rw-rw-r--
url.hpp
5.87
KB
-rw-rw-r--
url_manip.hpp
4.41
KB
-rw-rw-r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : cast.hpp
// Copyright (c) 2023, QuantStack and Mamba Contributors // // Distributed under the terms of the BSD 3-Clause License. // // The full license is in the file LICENSE, distributed with this software. #ifndef MAMBA_CORE_UTIL_CAST_HPP #define MAMBA_CORE_UTIL_CAST_HPP #include <limits> #include <stdexcept> #include <type_traits> #include <fmt/format.h> #include "mamba/util/compare.hpp" namespace mamba::util { /** * A safe cast between arithmetic types. * * If the conversion leads to an overflow, the cast will throw an ``std::overflow_error``. * If the conversion to a floating point type loses precision, the cast will throw a * ``std::runtime_error``. */ template <typename To, typename From> constexpr auto safe_num_cast(const From& val) -> To; /******************** * Implementation * ********************/ namespace detail { template <typename To, typename From> constexpr auto make_overflow_error(const From& val) { return std::overflow_error{ fmt::format( "Value to cast ({}) is out of destination range ([{}, {}])", val, std::numeric_limits<To>::lowest(), std::numeric_limits<To>::max() ) }; }; } template <typename To, typename From> constexpr auto safe_num_cast(const From& val) -> To { static_assert(std::is_arithmetic_v<From>); static_assert(std::is_arithmetic_v<To>); constexpr auto to_lowest = std::numeric_limits<To>::lowest(); constexpr auto to_max = std::numeric_limits<To>::max(); constexpr auto from_lowest = std::numeric_limits<From>::lowest(); constexpr auto from_max = std::numeric_limits<From>::max(); if constexpr (std::is_same_v<From, To>) { return val; } else if constexpr (std::is_integral_v<From> && std::is_integral_v<To>) { if constexpr (cmp_less(from_lowest, to_lowest)) { if (cmp_less(val, to_lowest)) { throw detail::make_overflow_error<To>(val); } } if constexpr (cmp_greater(from_max, to_max)) { if (cmp_greater(val, to_max)) { throw detail::make_overflow_error<To>(val); } } return static_cast<To>(val); } else { using float_type = std::common_type_t<From, To>; constexpr auto float_cast = [](const auto& x) { return static_cast<float_type>(x); }; if constexpr (float_cast(from_lowest) < float_cast(to_lowest)) { if (float_cast(val) < float_cast(to_lowest)) { throw detail::make_overflow_error<To>(val); } } if constexpr (float_cast(from_max) > float_cast(to_max)) { if (float_cast(val) > float_cast(to_max)) { throw detail::make_overflow_error<To>(val); } } To cast = static_cast<To>(val); From cast_back = static_cast<From>(cast); if (cast_back != val) { throw std::runtime_error{ fmt::format("Casting from {} to {} loses precision", val, cast) }; } return cast; } } } #endif
Close