1
0
forked from boostorg/core

More cosmetic fixes in ref tests.

This commit is contained in:
Peter Dimov
2014-06-10 03:26:09 +03:00
parent c48adcc3ea
commit 78892a472a
3 changed files with 24 additions and 12 deletions

View File

@@ -1,8 +1,12 @@
//
// Test that a reference_wrapper can't be constructed from an rvalue
//
// Copyright 2014 Agustin Berge
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//
#include <boost/ref.hpp>
@@ -10,7 +14,7 @@
int main()
{
boost::reference_wrapper<int const> r(1); // this should produce an ERROR
boost::reference_wrapper<int const> r( 1 ); // this should produce an ERROR
}
#else

View File

@@ -1,12 +1,16 @@
//
// Test that an rvalue can't be passed to ref()
//
// Copyright 2014 Agustin Berge
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//
#include <boost/ref.hpp>
int main()
{
boost::reference_wrapper<int> r = boost::ref(2); // this should produce an ERROR
boost::reference_wrapper<int> r = boost::ref( 2 ); // this should produce an ERROR
}

View File

@@ -1,8 +1,12 @@
//
// Test that a const rvalue can't be passed to ref()
//
// Copyright 2014 Agustin Berge
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//
#include <boost/ref.hpp>
@@ -14,7 +18,7 @@ X const crv() { return X(); }
int main()
{
boost::reference_wrapper<X const> r = boost::ref(crv()); // this should produce an ERROR
boost::reference_wrapper<X const> r = boost::ref( crv() ); // this should produce an ERROR
}
#else