Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r72043 - trunk/libs/config/test
From: john_at_[hidden]
Date: 2011-05-19 05:32:33


Author: johnmaddock
Date: 2011-05-19 05:32:31 EDT (Thu, 19 May 2011)
New Revision: 72043
URL: http://svn.boost.org/trac/boost/changeset/72043

Log:
Add needed missing files.
Added:
   trunk/libs/config/test/boost_no_unified_init.ipp (contents, props changed)
   trunk/libs/config/test/no_unified_init_fail.cpp (contents, props changed)
   trunk/libs/config/test/no_unified_init_pass.cpp (contents, props changed)

Added: trunk/libs/config/test/boost_no_unified_init.ipp
==============================================================================
--- (empty file)
+++ trunk/libs/config/test/boost_no_unified_init.ipp 2011-05-19 05:32:31 EDT (Thu, 19 May 2011)
@@ -0,0 +1,53 @@
+// Copyright (C) 2011 John Maddock
+// 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 most recent version.
+
+// MACRO: BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX
+// TITLE: C++0x unified initialization syntax unavailable
+// DESCRIPTION: The compiler does not support C++0x unified initialization syntax: see http://en.wikipedia.org/wiki/C%2B%2B0x#Uniform_initialization
+
+namespace boost_no_unified_initialization_syntax {
+
+struct BasicStruct
+{
+ int x;
+ double y;
+};
+
+struct AltStruct
+{
+public:
+ AltStruct(int x, double y) : x_{x}, y_{y} {}
+private:
+ int x_;
+ double y_;
+};
+
+struct IdString
+{
+ std::string name;
+ int identifier;
+ bool operator == (const IdString& other)
+ {
+ return identifier == other.identifier && name == other.name;
+ }
+};
+
+IdString get_string()
+{
+ return {"SomeName", 4}; //Note the lack of explicit type.
+}
+
+int test()
+{
+ BasicStruct var1{5, 3.2};
+ AltStruct var2{2, 4.3};
+
+ IdString id{"SomeName", 4};
+ return id == get_string() ? 0 : 1;
+}
+
+}

Added: trunk/libs/config/test/no_unified_init_fail.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/config/test/no_unified_init_fail.cpp 2011-05-19 05:32:31 EDT (Thu, 19 May 2011)
@@ -0,0 +1,37 @@
+// This file was automatically generated on Mon May 09 12:11:17 2011
+// 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: generate.cpp 70001 2011-03-15 13:17:46Z johnmaddock $
+//
+
+
+// Test file for macro BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX
+// This file should not compile, if it does then
+// BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX should not be defined.
+// See file boost_no_unified_init.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_UNIFIED_INITIALIZATION_SYNTAX
+#include "boost_no_unified_init.ipp"
+#else
+#error "this file should not compile"
+#endif
+
+int main( int, char *[] )
+{
+ return boost_no_unified_initialization_syntax::test();
+}
+

Added: trunk/libs/config/test/no_unified_init_pass.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/config/test/no_unified_init_pass.cpp 2011-05-19 05:32:31 EDT (Thu, 19 May 2011)
@@ -0,0 +1,37 @@
+// This file was automatically generated on Mon May 09 12:11:17 2011
+// 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: generate.cpp 70001 2011-03-15 13:17:46Z johnmaddock $
+//
+
+
+// Test file for macro BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX
+// This file should compile, if it does not then
+// BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX should be defined.
+// See file boost_no_unified_init.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_UNIFIED_INITIALIZATION_SYNTAX
+#include "boost_no_unified_init.ipp"
+#else
+namespace boost_no_unified_initialization_syntax = empty_boost;
+#endif
+
+int main( int, char *[] )
+{
+ return boost_no_unified_initialization_syntax::test();
+}
+


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk