Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      operator==, operator<=>(std::basic_stacktrace)

      From cppreference.com
      <cpp‎ |utility‎ |basic stacktrace
       
       
      Diagnostics library
       
       
      template<class Allocator2>

      friendbool operator==(const basic_stacktrace& lhs,

                             const basic_stacktrace<Allocator2>& rhs)noexcept;
      (1)(since C++23)
      template<class Allocator2>

      friendstd::strong_ordering
          operator<=>(const basic_stacktrace& lhs,

                       const basic_stacktrace<Allocator2>& rhs)noexcept;
      (2)(since C++23)
      1) Checks if the contents oflhs andrhs are equal, that is, they have the same number of elements and each element inlhs compares equal with the element inrhs at the same position.
      Equivalent toreturnstd::equal(lhs.begin(), lhs.end(), rhs.begin(), rhs.end());.
      2) Returns the relative order of the numbers of stacktrace entries inlhs andrhs if they are not equal. Otherwise (if the numbers of elements oflhs andrhs are equal), returns the lexicographical order of the elements oflhs andrhs.
      Equivalent to
      if(auto cmp= lhs.size()<=> rhs.size(); cmp!=0)

         return cmp;
      else
         returnstd::lexicographical_compare_three_way(lhs.begin(), lhs.end(),

                                                        rhs.begin(), rhs.end());
      .

      These function templates are not visible to ordinaryunqualified orqualified lookup, and can only be found byargument-dependent lookup when std::basic_stacktrace<Allocator> is an associated class of the arguments.

      The<,<=,>,>=, and!= operators aresynthesized fromoperator<=> andoperator== respectively.

      Contents

      [edit]Parameters

      lhs, rhs -basic_stacktraces whose contents to compare

      [edit]Return value

      1)true if the contents oflhs andrhs are equal,false otherwise.
      2)lhs.size()<=> rhs.size() if the result is notstd::strong_order::equal, the lexicographical order of the elements oflhs andrhs otherwise.

      [edit]Complexity

      1,2) Constant iflhs andrhs are of different size, linear in the size oflhs otherwise.

      [edit]Example

      This section is incomplete
      Reason: no example
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/utility/basic_stacktrace/operator_cmp&oldid=160657"

      [8]ページ先頭

      ©2009-2025 Movatter.jp