473f838128
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@160184 91177308-0d34-0410-b5e6-96231b3b80d8
34 lines
775 B
C++
34 lines
775 B
C++
//===----------------------------------------------------------------------===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is dual licensed under the MIT and the University of Illinois Open
|
|
// Source Licenses. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// <chrono>
|
|
|
|
// duration
|
|
|
|
// duration operator-() const;
|
|
|
|
#include <chrono>
|
|
#include <cassert>
|
|
|
|
int main()
|
|
{
|
|
{
|
|
const std::chrono::minutes m(3);
|
|
std::chrono::minutes m2 = -m;
|
|
assert(m2.count() == -m.count());
|
|
}
|
|
#ifndef _LIBCPP_HAS_NO_CONSTEXPR
|
|
{
|
|
constexpr std::chrono::minutes m(3);
|
|
constexpr std::chrono::minutes m2 = -m;
|
|
static_assert(m2.count() == -m.count(), "");
|
|
}
|
|
#endif
|
|
}
|