summaryrefslogtreecommitdiffstats
path: root/contrib/restricted/boost/locale/src/shared/mo_lambda.hpp
diff options
context:
space:
mode:
authorthegeorg <[email protected]>2025-05-07 11:09:12 +0300
committerthegeorg <[email protected]>2025-05-07 11:25:22 +0300
commit4c98f14a2491da2bc1a9d40fed1d1682c7ec5dd6 (patch)
tree8142081775c27c8780fa0282a0273ee268e13b98 /contrib/restricted/boost/locale/src/shared/mo_lambda.hpp
parent40b86c68b431bb65d67bba51ef9159066a833b68 (diff)
Update contrib/restricted/boost/locale to 1.88.0
commit_hash:87b595328ea79c6ba38cb973580804486ca4a3ff
Diffstat (limited to 'contrib/restricted/boost/locale/src/shared/mo_lambda.hpp')
-rw-r--r--contrib/restricted/boost/locale/src/shared/mo_lambda.hpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/contrib/restricted/boost/locale/src/shared/mo_lambda.hpp b/contrib/restricted/boost/locale/src/shared/mo_lambda.hpp
new file mode 100644
index 00000000000..ff415175def
--- /dev/null
+++ b/contrib/restricted/boost/locale/src/shared/mo_lambda.hpp
@@ -0,0 +1,37 @@
+//
+// Copyright (c) 2009-2011 Artyom Beilis (Tonkikh)
+// Copyright (c) 2021-2023 Alexander Grund
+//
+// Distributed under the Boost Software License, Version 1.0.
+// https://www.boost.org/LICENSE_1_0.txt
+
+#ifndef BOOST_SRC_LOCALE_MO_LAMBDA_HPP_INCLUDED
+#define BOOST_SRC_LOCALE_MO_LAMBDA_HPP_INCLUDED
+
+#include <boost/locale/config.hpp>
+#include <memory>
+
+namespace boost { namespace locale { namespace gnu_gettext { namespace lambda {
+
+ struct BOOST_SYMBOL_VISIBLE expr {
+ using value_type = long long;
+ virtual value_type operator()(value_type n) const = 0;
+ virtual ~expr() = default;
+ };
+ using expr_ptr = std::unique_ptr<expr>;
+
+ class plural_expr {
+ expr_ptr p_;
+
+ public:
+ plural_expr() = default;
+ explicit plural_expr(expr_ptr p) : p_(std::move(p)) {}
+ expr::value_type operator()(expr::value_type n) const { return (*p_)(n); }
+ explicit operator bool() const { return static_cast<bool>(p_); }
+ };
+
+ BOOST_LOCALE_DECL plural_expr compile(const char* c_expression);
+
+}}}} // namespace boost::locale::gnu_gettext::lambda
+
+#endif