Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::chrono::day::ok

      From cppreference.com
      <cpp‎ |chrono‎ |day
       
       
      Date and time library
       
       
      constexprbool ok()constnoexcept;
      (since C++20)

      Checks if the day value stored in*this is in the valid range, i.e.,[131].

      [edit]Return value

      true if the day value stored in*this is in the range[131]. Otherwisefalse.

      [edit]Example

      Run this code
      #include <chrono>usingnamespace std::chrono_literals; constexprstd::chrono::day d0{00};constexprstd::chrono::day d1{13};constexprstd::chrono::day d2{42}; static_assert(    d0== 0d&&!d0.ok()&&    d1== 13d&& d1.ok()&&    d2== 42d&&!d2.ok()); int main(){}

      [edit]See also

      retrieves the stored day value
      (public member function)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/chrono/day/ok&oldid=161525"

      [8]ページ先頭

      ©2009-2025 Movatter.jp