/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // Operations supported by all ThriftType values. #pragma once #include #include namespace apache { namespace thrift { namespace op { template struct EqualTo : detail::EqualTo {}; /// A binary operator that returns true iff the given Thrift values are equal to /// each other. /// /// For example: /// * equal(1, 2) -> false /// * equal(0.0, -0.0) -> true /// * equal(NaN, NaN) -> false /// * equal>([NaN, 0.0], [NaN, -0.0]) -> false template inline constexpr EqualTo, type::infer_tag> equal{}; template struct IdenticalTo : detail::IdenticalTo {}; /// A binary operator that returns true iff the given Thrift values are /// identical to each other (i.e. they are same representations). /// /// For example: /// * identical(1, 2) -> false /// * identical(0.0, -0.0) -> false /// * identical(NaN, NaN) -> true /// * identical>([NaN, 0.0], [NaN, -0.0]) -> false template inline constexpr IdenticalTo> identical{}; template struct Less : detail::LessThan {}; /// A binary operator that returns true iff one Thrift values is less than /// the another. /// /// For example: /// * less(1, 2) -> true /// * less(0.0, -0.0) -> false /// * less(NaN, NaN) -> false template inline constexpr Less, type::infer_tag> less{}; /// Compares two Thrift values, returning the associated folly::ordering value. /// /// For example: /// * compare(1, 2) -> folly::ordering::lt /// * less(0.0, -0.0) -> folly::ordering::eq /// * compare("aa", "a") -> folly::ordering::gt template inline constexpr detail:: CompareWith, type::infer_tag> compare{}; } // namespace op } // namespace thrift } // namespace apache