Path: blob/main/contrib/llvm-project/libcxx/include/__chrono/literals.h
35262 views
// -*- C++ -*-1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//89#ifndef _LIBCPP___CHRONO_LITERALS_H10#define _LIBCPP___CHRONO_LITERALS_H1112#include <__chrono/day.h>13#include <__chrono/year.h>14#include <__config>1516#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)17# pragma GCC system_header18#endif1920#if _LIBCPP_STD_VER >= 202122_LIBCPP_BEGIN_NAMESPACE_STD2324inline namespace literals {25inline namespace chrono_literals {26_LIBCPP_HIDE_FROM_ABI constexpr chrono::day operator""d(unsigned long long __d) noexcept {27return chrono::day(static_cast<unsigned>(__d));28}2930_LIBCPP_HIDE_FROM_ABI constexpr chrono::year operator""y(unsigned long long __y) noexcept {31return chrono::year(static_cast<int>(__y));32}33} // namespace chrono_literals34} // namespace literals3536namespace chrono { // hoist the literals into namespace std::chrono37using namespace literals::chrono_literals;38} // namespace chrono3940_LIBCPP_END_NAMESPACE_STD4142#endif // _LIBCPP_STD_VER >= 204344#endif // _LIBCPP___CHRONO_LITERALS_H454647