// class istream_iterator
// istream_iterator(const istream_iterator& x);
-// C++17 says: If is_trivially_copy_constructible_v<T> is true, then
-// this constructor shall beis a trivial copy constructor.
#include <iterator>
#include <sstream>
#include <cassert>
-#include "test_macros.h"
-
int main()
{
{
// class istream_iterator
// constexpr istream_iterator();
-// C++17 says: If is_trivially_default_constructible_v<T> is true, then this
-// constructor shall beis a constexpr constructor.
#include <iterator>
#include <cassert>
-#include <string>
#include "test_macros.h"
-struct S { S(); }; // not constexpr
-
-#if TEST_STD_VER > 14
-template <typename T, bool isTrivial = std::is_trivially_default_constructible_v<T>>
-struct test_trivial {
-void operator ()() const {
- constexpr std::istream_iterator<T> it;
- }
-};
-
-template <typename T>
-struct test_trivial<T, false> {
-void operator ()() const {}
-};
-#endif
-
-
int main()
{
{
#endif
}
-#if TEST_STD_VER > 14
- test_trivial<int>()();
- test_trivial<char>()();
- test_trivial<double>()();
- test_trivial<S>()();
- test_trivial<std::string>()();
-#endif
}
// typedef basic_istream<charT,traits> istream_type;
// ...
//
-// Before C++17, we have:
// If T is a literal type, then the default constructor shall be a constexpr constructor.
// If T is a literal type, then this constructor shall be a trivial copy constructor.
// If T is a literal type, then this destructor shall be a trivial destructor.
-// C++17 says:
-// If is_trivially_default_constructible_v<T> is true, then
-// this constructor (the default ctor) shall beis a constexpr constructor.
-// If is_trivially_copy_constructible_v<T> is true, then
-// this constructor (the copy ctor) shall beis a trivial copy constructor.
-// If is_trivially_destructible_v<T> is true, then this
-// destructor shall beis a trivial destructor.
-// Testing the C++17 ctors for this are in the ctor tests.
#include <iterator>
#include <type_traits>
int main()
{
- typedef std::istream_iterator<double> I1; // double is trivially destructible
+ typedef std::istream_iterator<double> I1;
static_assert((std::is_convertible<I1,
std::iterator<std::input_iterator_tag, double, std::ptrdiff_t,
const double*, const double&> >::value), "");
static_assert( std::is_trivially_copy_constructible<I1>::value, "");
static_assert( std::is_trivially_destructible<I1>::value, "");
- typedef std::istream_iterator<unsigned, wchar_t> I2; // unsigned is trivially destructible
+ typedef std::istream_iterator<unsigned, wchar_t> I2;
static_assert((std::is_convertible<I2,
std::iterator<std::input_iterator_tag, unsigned, std::ptrdiff_t,
const unsigned*, const unsigned&> >::value), "");
static_assert( std::is_trivially_copy_constructible<I2>::value, "");
static_assert( std::is_trivially_destructible<I2>::value, "");
- typedef std::istream_iterator<std::string> I3; // string is NOT trivially destructible
+ typedef std::istream_iterator<std::string> I3;
static_assert(!std::is_trivially_copy_constructible<I3>::value, "");
static_assert(!std::is_trivially_destructible<I3>::value, "");
}
<tr><td><a href="http://wg21.link/P0426R1">P0426R1</a></td><td>LWG</td><td>Constexpr for <tt>std::char_traits</tt></td><td>Issaquah</td><td></td><td></td></tr>
<tr><td><a href="http://wg21.link/P0435R1">P0435R1</a></td><td>LWG</td><td>Resolving LWG Issues re <tt>common_type</tt></td><td>Issaquah</td><td></td><td></td></tr>
<tr><td><a href="http://wg21.link/P0502R0">P0502R0</a></td><td>LWG</td><td>Throwing out of a parallel algorithm terminates - but how?</td><td>Issaquah</td><td></td><td></td></tr>
- <tr><td><a href="http://wg21.link/P0503R0">P0503R0</a></td><td>LWG</td><td>Correcting library usage of "literal type"</td><td>Issaquah</td><td>Complete</td><td>4.0</td></tr>
+ <tr><td><a href="http://wg21.link/P0503R0">P0503R0</a></td><td>LWG</td><td>Correcting library usage of "literal type"</td><td>Issaquah</td><td></td><td></td></tr>
<tr><td><a href="http://wg21.link/P0504R0">P0504R0</a></td><td>LWG</td><td>Revisiting in-place tag types for any/optional/variant</td><td>Issaquah</td><td></td><td></td></tr>
<tr><td><a href="http://wg21.link/P0505R0">P0505R0</a></td><td>LWG</td><td>Wording for GB 50 - constexpr for chrono</td><td>Issaquah</td><td></td><td></td></tr>
<tr><td><a href="http://wg21.link/P0508R0">P0508R0</a></td><td>LWG</td><td>Wording for GB 58 - structured bindings for node_handles</td><td>Issaquah</td><td></td><td></td></tr>
- <tr><td><a href="http://wg21.link/P0509R1">P0509R1</a></td><td>LWG</td><td>Updating “Restrictions on exception handling”</td><td>Issaquah</td><td><i>Nothing to do</i></td><td>n/a</td></tr>
+ <tr><td><a href="http://wg21.link/P0509R1">P0509R1</a></td><td>LWG</td><td>Updating “Restrictions on exception handling”</td><td>Issaquah</td><td></td><td></td></tr>
<tr><td><a href="http://wg21.link/P0510R0">P0510R0</a></td><td>LWG</td><td>Disallowing references, incomplete types, arrays, and empty variants</td><td>Issaquah</td><td></td><td></td></tr>
<tr><td><a href="http://wg21.link/P0513R0">P0513R0</a></td><td>LWG</td><td>Poisoning the Hash</td><td>Issaquah</td><td></td><td></td></tr>
<tr><td><a href="http://wg21.link/P0516R0">P0516R0</a></td><td>LWG</td><td>Clarify That shared_future’s Copy Operations have Wide Contracts</td><td>Issaquah</td><td>Complete</td><td>4.0</td></tr>
<tr><td><a href="http://wg21.link/P0517R0">P0517R0</a></td><td>LWG</td><td>Make future_error Constructible</td><td>Issaquah</td><td>Complete</td><td>4.0</td></tr>
- <tr><td><a href="http://wg21.link/P0521R0">P0521R0</a></td><td>LWG</td><td>Proposed Resolution for CA 14 (shared_ptr use_count/unique)</td><td>Issaquah</td><td><i>Nothing to do</i></td><td>n/a</td></tr>
+ <tr><td><a href="http://wg21.link/P0521R0">P0521R0</a></td><td>LWG</td><td>Proposed Resolution for CA 14 (shared_ptr use_count/unique)</td><td>Issaquah</td><td></td><td></td></tr>
<!-- <tr><td></td><td></td><td></td><td></td><td></td><td></td></tr> -->
</table>