Skip to content

Commit

Permalink
Added macro BOOST_NO_CXX11_DEFAULTED_MOVES
Browse files Browse the repository at this point in the history
  • Loading branch information
akrzemi1 committed Jan 3, 2018
1 parent 24a2cc6 commit 3ec5a2b
Show file tree
Hide file tree
Showing 13 changed files with 135 additions and 4 deletions.
3 changes: 2 additions & 1 deletion checks/Jamfile.v2
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# *** DO NOT EDIT THIS FILE BY HAND ***
# This file was automatically generated on Sun Jul 9 16:30:35 2017
# This file was automatically generated on Wed Jan 03 23:31:31 2018
# by libs/config/tools/generate.cpp
# Copyright John Maddock.
# Use, modification and distribution are subject to the
Expand Down Expand Up @@ -67,6 +67,7 @@ obj cxx11_addressof : test_case.cpp : <define>TEST_BOOST_NO_CXX11_ADDRESSOF ;
obj cxx11_alignas : test_case.cpp : <define>TEST_BOOST_NO_CXX11_ALIGNAS ;
obj cxx11_allocator : test_case.cpp : <define>TEST_BOOST_NO_CXX11_ALLOCATOR ;
obj cxx11_atomic_smart_ptr : test_case.cpp : <define>TEST_BOOST_NO_CXX11_ATOMIC_SMART_PTR ;
obj cxx11_defaulted_moves : test_case.cpp : <define>TEST_BOOST_NO_CXX11_DEFAULTED_MOVES ;
obj cxx11_final : test_case.cpp : <define>TEST_BOOST_NO_CXX11_FINAL ;
obj cxx11_hdr_array : test_case.cpp : <define>TEST_BOOST_NO_CXX11_HDR_ARRAY ;
obj cxx11_hdr_atomic : test_case.cpp : <define>TEST_BOOST_NO_CXX11_HDR_ATOMIC ;
Expand Down
7 changes: 6 additions & 1 deletion checks/test_case.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was automatically generated on Sun Jul 9 16:30:35 2017
// This file was automatically generated on Wed Jan 03 23:31:31 2018
// by libs/config/tools/generate.cpp
// Copyright John Maddock 2002-4.
// Use, modification and distribution are subject to the
Expand Down Expand Up @@ -291,6 +291,11 @@
# error "Defect macro BOOST_NO_CXX11_ATOMIC_SMART_PTR is defined."
# endif
#endif
#ifdef TEST_BOOST_NO_CXX11_DEFAULTED_MOVES
# ifdef BOOST_NO_CXX11_DEFAULTED_MOVES
# error "Defect macro BOOST_NO_CXX11_DEFAULTED_MOVES is defined."
# endif
#endif
#ifdef TEST_BOOST_NO_CXX11_FINAL
# ifdef BOOST_NO_CXX11_FINAL
# error "Defect macro BOOST_NO_CXX11_FINAL is defined."
Expand Down
3 changes: 3 additions & 0 deletions doc/macro_reference.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,9 @@ deleted (`= delete`) functions.
[[`BOOST_NO_CXX11_DEFAULTED_FUNCTIONS`][The compiler does not support
defaulted (`= default`) functions.
]]
[[`BOOST_NO_CXX11_DEFAULTED_MOVES`][The compiler does not support
defaulted move constructor or assignment. Other defaulted functions may still be supported.
]]
[[`BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS`][The compiler does not support
explicit conversion operators (`explicit operator T()`).
]]
Expand Down
1 change: 1 addition & 0 deletions include/boost/config/compiler/borland.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
#define BOOST_NO_CXX11_CONSTEXPR
#define BOOST_NO_CXX11_DECLTYPE_N3276
#define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
#define BOOST_NO_CXX11_DEFAULTED_MOVES
#define BOOST_NO_CXX11_DELETED_FUNCTIONS
#define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
#define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
Expand Down
1 change: 1 addition & 0 deletions include/boost/config/compiler/gcc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@
//
#if (BOOST_GCC_VERSION < 40600) || !defined(BOOST_GCC_CXX11)
#define BOOST_NO_CXX11_CONSTEXPR
#define BOOST_NO_CXX11_DEFAULTED_MOVES
#define BOOST_NO_CXX11_NOEXCEPT
#define BOOST_NO_CXX11_NULLPTR
#define BOOST_NO_CXX11_RANGE_BASED_FOR
Expand Down
1 change: 1 addition & 0 deletions include/boost/config/compiler/visualc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@
//
#if (_MSC_FULL_VER < 190023026)
# define BOOST_NO_CXX11_NOEXCEPT
# define BOOST_NO_CXX11_DEFAULTED_MOVES
# define BOOST_NO_CXX11_REF_QUALIFIERS
# define BOOST_NO_CXX11_USER_DEFINED_LITERALS
# define BOOST_NO_CXX11_ALIGNAS
Expand Down
5 changes: 5 additions & 0 deletions include/boost/config/detail/suffix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,11 @@ namespace std{ using ::type_info; }
# define BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS
#endif

// Lack of defaulted moves is implied by the lack of either rvalue references or any dafaulted functions

This comment has been minimized.

Copy link
@KindDragon

KindDragon Feb 19, 2018

Contributor

typo dafaulted

#if !defined(BOOST_NO_CXX11_DEFAULTED_MOVES) && (defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) || defined(BOOST_NO_CXX11_RVALUE_REFERENCES))
# define BOOST_NO_CXX11_DEFAULTED_MOVES
#endif

// Defaulted and deleted function declaration helpers
// These macros are intended to be inside a class definition.
// BOOST_DEFAULTED_FUNCTION accepts the function declaration and its
Expand Down
5 changes: 4 additions & 1 deletion test/all/Jamfile.v2
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Regression test Jamfile for boost configuration setup.
# *** DO NOT EDIT THIS FILE BY HAND ***
# This file was automatically generated on Sun Jul 9 16:30:35 2017
# This file was automatically generated on Wed Jan 03 23:31:31 2018
# by libs/config/tools/generate.cpp
# Copyright John Maddock.
# Use, modification and distribution are subject to the
Expand Down Expand Up @@ -190,6 +190,9 @@ test-suite "BOOST_NO_CXX11_ALLOCATOR" :
test-suite "BOOST_NO_CXX11_ATOMIC_SMART_PTR" :
[ run ../no_cxx11_atomic_sp_pass.cpp ]
[ compile-fail ../no_cxx11_atomic_sp_fail.cpp ] ;
test-suite "BOOST_NO_CXX11_DEFAULTED_MOVES" :
[ run ../no_cxx11_defaulted_moves_pass.cpp ]
[ compile-fail ../no_cxx11_defaulted_moves_fail.cpp ] ;
test-suite "BOOST_NO_CXX11_FINAL" :
[ run ../no_cxx11_final_pass.cpp ]
[ compile-fail ../no_cxx11_final_fail.cpp ] ;
Expand Down
25 changes: 25 additions & 0 deletions test/boost_no_cxx11_defaulted_moves.ipp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// (C) Copyright Andrzej Krzemienski 2018

// Use, modification and distribution are subject to 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)

// See http://www.boost.org/libs/config for more information.

// MACRO: BOOST_NO_CXX11_DEFAULTED_MOVES
// TITLE: C++0x defaulting of move constructor/assignmet unavailable
// DESCRIPTION: The compiler does not support C++0x defaulting of move constructor/assignmet

namespace boost_no_cxx11_defaulted_moves {

struct foo {
foo(foo&&) = default;
foo& operator=(foo&&) = default;
};

int test()
{
return 0;
}

}
2 changes: 2 additions & 0 deletions test/config_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1068,6 +1068,7 @@ void print_boost_macros()
PRINT_MACRO(BOOST_NO_CXX11_DECLTYPE);
PRINT_MACRO(BOOST_NO_CXX11_DECLTYPE_N3276);
PRINT_MACRO(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS);
PRINT_MACRO(BOOST_NO_CXX11_DEFAULTED_MOVES);
PRINT_MACRO(BOOST_NO_CXX11_DELETED_FUNCTIONS);
PRINT_MACRO(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS);
PRINT_MACRO(BOOST_NO_CXX11_EXTERN_TEMPLATE);
Expand Down Expand Up @@ -1200,6 +1201,7 @@ void print_boost_macros()
PRINT_MACRO(BOOST_NO_VOID_RETURNS);



// END GENERATED BLOCK

PRINT_MACRO(BOOST_INTEL);
Expand Down
12 changes: 11 additions & 1 deletion test/config_test.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was automatically generated on Sun Jul 9 16:30:35 2017
// This file was automatically generated on Wed Jan 03 23:31:31 2018
// by libs/config/tools/generate.cpp
// Copyright John Maddock 2002-4.
// Use, modification and distribution are subject to the
Expand Down Expand Up @@ -122,6 +122,11 @@ namespace boost_no_cxx11_allocator = empty_boost;
#else
namespace boost_no_cxx11_atomic_smart_ptr = empty_boost;
#endif
#ifndef BOOST_NO_CXX11_DEFAULTED_MOVES
#include "boost_no_cxx11_defaulted_moves.ipp"
#else
namespace boost_no_cxx11_defaulted_moves = empty_boost;
#endif
#ifndef BOOST_NO_CXX11_FINAL
#include "boost_no_cxx11_final.ipp"
#else
Expand Down Expand Up @@ -1261,6 +1266,11 @@ int main( int, char *[] )
std::cerr << "Failed test for BOOST_NO_CXX11_ATOMIC_SMART_PTR at: " << __FILE__ << ":" << __LINE__ << std::endl;
++error_count;
}
if(0 != boost_no_cxx11_defaulted_moves::test())
{
std::cerr << "Failed test for BOOST_NO_CXX11_DEFAULTED_MOVES at: " << __FILE__ << ":" << __LINE__ << std::endl;
++error_count;
}
if(0 != boost_no_cxx11_final::test())
{
std::cerr << "Failed test for BOOST_NO_CXX11_FINAL at: " << __FILE__ << ":" << __LINE__ << std::endl;
Expand Down
37 changes: 37 additions & 0 deletions test/no_cxx11_defaulted_moves_fail.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// This file was automatically generated on Wed Jan 03 23:31:30 2018
// by libs/config/tools/generate.cpp
// Copyright John Maddock 2002-4.
// Use, modification and distribution are subject to 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)

// See http://www.boost.org/libs/config for the most recent version.//
// Revision $Id$
//


// Test file for macro BOOST_NO_CXX11_DEFAULTED_MOVES
// This file should not compile, if it does then
// BOOST_NO_CXX11_DEFAULTED_MOVES should not be defined.
// See file boost_no_cxx11_defaulted_moves.ipp for details

// Must not have BOOST_ASSERT_CONFIG set; it defeats
// the objective of this file:
#ifdef BOOST_ASSERT_CONFIG
# undef BOOST_ASSERT_CONFIG
#endif

#include <boost/config.hpp>
#include "test.hpp"

#ifdef BOOST_NO_CXX11_DEFAULTED_MOVES
#include "boost_no_cxx11_defaulted_moves.ipp"
#else
#error "this file should not compile"
#endif

int main( int, char *[] )
{
return boost_no_cxx11_defaulted_moves::test();
}

37 changes: 37 additions & 0 deletions test/no_cxx11_defaulted_moves_pass.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// This file was automatically generated on Wed Jan 03 23:31:30 2018
// by libs/config/tools/generate.cpp
// Copyright John Maddock 2002-4.
// Use, modification and distribution are subject to 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)

// See http://www.boost.org/libs/config for the most recent version.//
// Revision $Id$
//


// Test file for macro BOOST_NO_CXX11_DEFAULTED_MOVES
// This file should compile, if it does not then
// BOOST_NO_CXX11_DEFAULTED_MOVES should be defined.
// See file boost_no_cxx11_defaulted_moves.ipp for details

// Must not have BOOST_ASSERT_CONFIG set; it defeats
// the objective of this file:
#ifdef BOOST_ASSERT_CONFIG
# undef BOOST_ASSERT_CONFIG
#endif

#include <boost/config.hpp>
#include "test.hpp"

#ifndef BOOST_NO_CXX11_DEFAULTED_MOVES
#include "boost_no_cxx11_defaulted_moves.ipp"
#else
namespace boost_no_cxx11_defaulted_moves = empty_boost;
#endif

int main( int, char *[] )
{
return boost_no_cxx11_defaulted_moves::test();
}

0 comments on commit 3ec5a2b

Please sign in to comment.