1- /* auto-generated on 2023-07-23 15:03:22 -0400. Do not edit! */
1+ /* auto-generated on 2023-08-26 17:38:28 -0400. Do not edit! */
22/* begin file include/ada.h */
33/* *
44 * @file ada.h
@@ -1008,6 +1008,7 @@ ada_really_inline bool bit_at(const uint8_t a[], const uint8_t i) {
10081008#define ADA_CHECKERS_INL_H
10091009
10101010
1011+ #include < algorithm>
10111012#include < string_view>
10121013#include < cstring>
10131014
@@ -1058,7 +1059,7 @@ ada_really_inline constexpr bool begins_with(std::string_view view,
10581059 std::string_view prefix) {
10591060 // in C++20, you have view.begins_with(prefix)
10601061 return view.size () >= prefix.size () &&
1061- (view. substr ( 0 , prefix.size ()) == prefix );
1062+ std::equal (prefix. begin () , prefix.end (), view. begin () );
10621063}
10631064
10641065} // namespace ada::checkers
@@ -1406,6 +1407,25 @@ constexpr ada::scheme::type get_scheme_type(std::string_view scheme) noexcept;
14061407
14071408namespace ada {
14081409
1410+ /* *
1411+ * Type of URL host as an enum.
1412+ */
1413+ enum url_host_type : uint8_t {
1414+ /* *
1415+ * Represents common URLs such as "https://www.google.com"
1416+ */
1417+ DEFAULT = 0 ,
1418+ /* *
1419+ * Represents ipv4 addresses such as "http://127.0.0.1"
1420+ */
1421+ IPV4 = 1 ,
1422+ /* *
1423+ * Represents ipv6 addresses such as
1424+ * "http://[2001:db8:3333:4444:5555:6666:7777:8888]"
1425+ */
1426+ IPV6 = 2 ,
1427+ };
1428+
14091429/* *
14101430 * @brief Base class of URL implementations
14111431 *
@@ -1428,6 +1448,11 @@ struct url_base {
14281448 */
14291449 bool has_opaque_path{false };
14301450
1451+ /* *
1452+ * URL hosts type
1453+ */
1454+ url_host_type host_type = url_host_type::DEFAULT;
1455+
14311456 /* *
14321457 * @private
14331458 */
@@ -1768,8 +1793,8 @@ inline int fast_digit_count(uint32_t x) noexcept {
17681793#define TL_EXPECTED_HPP
17691794
17701795#define TL_EXPECTED_VERSION_MAJOR 1
1771- #define TL_EXPECTED_VERSION_MINOR 0
1772- #define TL_EXPECTED_VERSION_PATCH 1
1796+ #define TL_EXPECTED_VERSION_MINOR 1
1797+ #define TL_EXPECTED_VERSION_PATCH 0
17731798
17741799#include < exception>
17751800#include < functional>
@@ -1802,6 +1827,16 @@ inline int fast_digit_count(uint32_t x) noexcept {
18021827#define TL_EXPECTED_GCC55
18031828#endif
18041829
1830+ #if !defined(TL_ASSERT)
1831+ // can't have assert in constexpr in C++11 and GCC 4.9 has a compiler bug
1832+ #if (__cplusplus > 201103L) && !defined(TL_EXPECTED_GCC49)
1833+ #include < cassert>
1834+ #define TL_ASSERT (x ) assert (x)
1835+ #else
1836+ #define TL_ASSERT (x )
1837+ #endif
1838+ #endif
1839+
18051840#if (defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 9 && \
18061841 !defined (__clang__))
18071842// GCC < 5 doesn't support overloading on const&& for member functions
@@ -1957,6 +1992,7 @@ template <typename E>
19571992#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED
19581993 throw std::forward<E>(e);
19591994#else
1995+ (void )e;
19601996#ifdef _MSC_VER
19611997 __assume (0 );
19621998#else
@@ -2597,7 +2633,7 @@ struct expected_operations_base : expected_storage_base<T, E> {
25972633 geterr ().~unexpected<E>();
25982634 construct (std::move (rhs).get ());
25992635 } else {
2600- assign_common (rhs);
2636+ assign_common (std::move ( rhs) );
26012637 }
26022638 }
26032639
@@ -2960,7 +2996,7 @@ struct default_constructor_tag {
29602996};
29612997
29622998// expected_default_ctor_base will ensure that expected has a deleted default
2963- // constructor if T is not default constructible.
2999+ // consturctor if T is not default constructible.
29643000// This specialization is for when T is default constructible
29653001template <class T , class E ,
29663002 bool Enable =
@@ -3255,6 +3291,53 @@ class expected : private detail::expected_move_assign_base<T, E>,
32553291 return map_error_impl (std::move (*this ), std::forward<F>(f));
32563292 }
32573293#endif
3294+ #endif
3295+ #if defined(TL_EXPECTED_CXX14) && !defined(TL_EXPECTED_GCC49) && \
3296+ !defined (TL_EXPECTED_GCC54) && !defined (TL_EXPECTED_GCC55)
3297+ template <class F >
3298+ TL_EXPECTED_11_CONSTEXPR auto transform_error (F &&f) & {
3299+ return map_error_impl (*this , std::forward<F>(f));
3300+ }
3301+ template <class F >
3302+ TL_EXPECTED_11_CONSTEXPR auto transform_error (F &&f) && {
3303+ return map_error_impl (std::move (*this ), std::forward<F>(f));
3304+ }
3305+ template <class F >
3306+ constexpr auto transform_error (F &&f) const & {
3307+ return map_error_impl (*this , std::forward<F>(f));
3308+ }
3309+ template <class F >
3310+ constexpr auto transform_error (F &&f) const && {
3311+ return map_error_impl (std::move (*this ), std::forward<F>(f));
3312+ }
3313+ #else
3314+ template <class F >
3315+ TL_EXPECTED_11_CONSTEXPR decltype (map_error_impl(std::declval<expected &>(),
3316+ std::declval<F &&>()))
3317+ transform_error(F &&f) & {
3318+ return map_error_impl (*this , std::forward<F>(f));
3319+ }
3320+ template <class F >
3321+ TL_EXPECTED_11_CONSTEXPR decltype (map_error_impl(std::declval<expected &&>(),
3322+ std::declval<F &&>()))
3323+ transform_error(F &&f) && {
3324+ return map_error_impl (std::move (*this ), std::forward<F>(f));
3325+ }
3326+ template <class F >
3327+ constexpr decltype (map_error_impl(std::declval<const expected &>(),
3328+ std::declval<F &&>()))
3329+ transform_error(F &&f) const & {
3330+ return map_error_impl (*this , std::forward<F>(f));
3331+ }
3332+
3333+ #ifndef TL_EXPECTED_NO_CONSTRR
3334+ template <class F >
3335+ constexpr decltype (map_error_impl(std::declval<const expected &&>(),
3336+ std::declval<F &&>()))
3337+ transform_error(F &&f) const && {
3338+ return map_error_impl (std::move (*this ), std::forward<F>(f));
3339+ }
3340+ #endif
32583341#endif
32593342 template <class F >
32603343 expected TL_EXPECTED_11_CONSTEXPR or_else (F &&f) & {
@@ -3697,27 +3780,37 @@ class expected : private detail::expected_move_assign_base<T, E>,
36973780 }
36983781 }
36993782
3700- constexpr const T *operator ->() const { return valptr (); }
3701- TL_EXPECTED_11_CONSTEXPR T *operator ->() { return valptr (); }
3783+ constexpr const T *operator ->() const {
3784+ TL_ASSERT (has_value ());
3785+ return valptr ();
3786+ }
3787+ TL_EXPECTED_11_CONSTEXPR T *operator ->() {
3788+ TL_ASSERT (has_value ());
3789+ return valptr ();
3790+ }
37023791
37033792 template <class U = T,
37043793 detail::enable_if_t <!std::is_void<U>::value> * = nullptr >
37053794 constexpr const U &operator *() const & {
3795+ TL_ASSERT (has_value ());
37063796 return val ();
37073797 }
37083798 template <class U = T,
37093799 detail::enable_if_t <!std::is_void<U>::value> * = nullptr >
37103800 TL_EXPECTED_11_CONSTEXPR U &operator *() & {
3801+ TL_ASSERT (has_value ());
37113802 return val ();
37123803 }
37133804 template <class U = T,
37143805 detail::enable_if_t <!std::is_void<U>::value> * = nullptr >
37153806 constexpr const U &&operator *() const && {
3807+ TL_ASSERT (has_value ());
37163808 return std::move (val ());
37173809 }
37183810 template <class U = T,
37193811 detail::enable_if_t <!std::is_void<U>::value> * = nullptr >
37203812 TL_EXPECTED_11_CONSTEXPR U &&operator *() && {
3813+ TL_ASSERT (has_value ());
37213814 return std::move (val ());
37223815 }
37233816
@@ -3753,10 +3846,22 @@ class expected : private detail::expected_move_assign_base<T, E>,
37533846 return std::move (val ());
37543847 }
37553848
3756- constexpr const E &error () const & { return err ().value (); }
3757- TL_EXPECTED_11_CONSTEXPR E &error () & { return err ().value (); }
3758- constexpr const E &&error() const && { return std::move (err ().value ()); }
3759- TL_EXPECTED_11_CONSTEXPR E &&error() && { return std::move (err ().value ()); }
3849+ constexpr const E &error () const & {
3850+ TL_ASSERT (!has_value ());
3851+ return err ().value ();
3852+ }
3853+ TL_EXPECTED_11_CONSTEXPR E &error () & {
3854+ TL_ASSERT (!has_value ());
3855+ return err ().value ();
3856+ }
3857+ constexpr const E &&error() const && {
3858+ TL_ASSERT (!has_value ());
3859+ return std::move (err ().value ());
3860+ }
3861+ TL_EXPECTED_11_CONSTEXPR E &&error() && {
3862+ TL_ASSERT (!has_value ());
3863+ return std::move (err ().value ());
3864+ }
37603865
37613866 template <class U >
37623867 constexpr T value_or (U &&v) const & {
@@ -6609,6 +6714,7 @@ struct url_search_params {
66096714 * @see https://url.spec.whatwg.org/#dom-urlsearchparams-has
66106715 */
66116716 inline bool has (std::string_view key) noexcept ;
6717+ inline bool has (std::string_view key, std::string_view value) noexcept ;
66126718
66136719 /* *
66146720 * @see https://url.spec.whatwg.org/#dom-urlsearchparams-set
@@ -6733,6 +6839,15 @@ inline bool url_search_params::has(const std::string_view key) noexcept {
67336839 return entry != params.end ();
67346840}
67356841
6842+ inline bool url_search_params::has (std::string_view key,
6843+ std::string_view value) noexcept {
6844+ auto entry =
6845+ std::find_if (params.begin (), params.end (), [&key, &value](auto ¶m) {
6846+ return param.first == key && param.second == value;
6847+ });
6848+ return entry != params.end ();
6849+ }
6850+
67366851inline std::string url_search_params::to_string () {
67376852 auto character_set = ada::character_sets::WWW_FORM_URLENCODED_PERCENT_ENCODE;
67386853 std::string out{};
@@ -6807,14 +6922,14 @@ inline void url_search_params::sort() {
68076922#ifndef ADA_ADA_VERSION_H
68086923#define ADA_ADA_VERSION_H
68096924
6810- #define ADA_VERSION " 2.6.0 "
6925+ #define ADA_VERSION " 2.6.3 "
68116926
68126927namespace ada {
68136928
68146929enum {
68156930 ADA_VERSION_MAJOR = 2 ,
68166931 ADA_VERSION_MINOR = 6 ,
6817- ADA_VERSION_REVISION = 0 ,
6932+ ADA_VERSION_REVISION = 3 ,
68186933};
68196934
68206935} // namespace ada
0 commit comments