early-access version 3088

This commit is contained in:
pineappleEA
2022-11-05 15:35:56 +01:00
parent 4e4fc25ce3
commit b601909c6d
35519 changed files with 5996896 additions and 860 deletions

View File

@@ -0,0 +1,36 @@
// io_ex2.cpp ----------------------------------------------------------//
// Copyright 2010 Howard Hinnant
// Copyright 2010 Vicente J. Botet Escriba
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
/*
This code was adapted by Vicente J. Botet Escriba from Hinnant's html documentation.
Many thanks to Howard for making his code available under the Boost license.
*/
#include <boost/chrono/chrono_io.hpp>
#include <sstream>
#include <boost/assert.hpp>
int main()
{
using namespace boost::chrono;
std::istringstream in("5000 milliseconds 4000 ms 3001 ms");
seconds d(0);
in >> d;
BOOST_ASSERT(in.good());
BOOST_ASSERT(d == seconds(5));
in >> d;
BOOST_ASSERT(in.good());
BOOST_ASSERT(d == seconds(4));
in >> d;
BOOST_ASSERT(in.fail());
BOOST_ASSERT(d == seconds(4));
return 0;
}