//----------------------------------------------------------------------------- // ___ __ _ _ // / _ \__ _ _ __ ___ ___ / /(_)_ __ | | __ // / /_)/ _` | '__/ __|/ _ \/ / | | '_ \| |/ / // / ___/ (_| | | \__ \ __/ /__| | | | | < // \/ \__,_|_| |___/\___\____/_|_| |_|_|\_\ . // //----------------------------------------------------------------------------- // Author: Kurt Sassenrath // Module: proto // // Session ID. Used as a handle to access an existing user session, which can // also be used to share parse data without any linking of users. // // Copyright (c) 2023 Kurt Sassenrath. // // License TBD. //----------------------------------------------------------------------------- #ifndef session_id_6598f9bae1cbb501 #define session_id_6598f9bae1cbb501 #include #include #include namespace parselink { namespace proto { struct session_id { std::array bytes; session_id() noexcept; [[nodiscard]] constexpr auto operator<=>( session_id const& other) const noexcept { return bytes <=> other.bytes; } [[nodiscard]] constexpr auto operator<=>( std::span other) const noexcept { return std::lexicographical_compare_three_way(bytes.begin(), bytes.end(), other.begin(), other.end(), std::compare_three_way()); } }; } // namespace proto } // namespace parselink #endif // session_id_6598f9bae1cbb501