Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r52568 - in sandbox/SOC/2009/fusion: . fusion mini-fusion workaround workaround/conceptgcc
From: mr.chr.schmidt_at_[hidden]
Date: 2009-04-23 14:22:50


Author: cschmidt
Date: 2009-04-23 14:22:49 EDT (Thu, 23 Apr 2009)
New Revision: 52568
URL: http://svn.boost.org/trac/boost/changeset/52568

Log:
Added mini-fusion to test conceptgcc
Added:
   sandbox/SOC/2009/fusion/LICENSE_1_0.txt (contents, props changed)
   sandbox/SOC/2009/fusion/build.bat (contents, props changed)
   sandbox/SOC/2009/fusion/fusion/
   sandbox/SOC/2009/fusion/mini-fusion/
   sandbox/SOC/2009/fusion/mini-fusion/Jamfile.v2 (contents, props changed)
   sandbox/SOC/2009/fusion/mini-fusion/test.cpp (contents, props changed)
   sandbox/SOC/2009/fusion/project-root.jam (contents, props changed)
   sandbox/SOC/2009/fusion/user-config.jam (contents, props changed)
   sandbox/SOC/2009/fusion/workaround/
   sandbox/SOC/2009/fusion/workaround/conceptgcc/
   sandbox/SOC/2009/fusion/workaround/conceptgcc/utility (contents, props changed)

Added: sandbox/SOC/2009/fusion/LICENSE_1_0.txt
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/LICENSE_1_0.txt 2009-04-23 14:22:49 EDT (Thu, 23 Apr 2009)
@@ -0,0 +1,23 @@
+Boost Software License - Version 1.0 - August 17th, 2003
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.

Added: sandbox/SOC/2009/fusion/build.bat
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/build.bat 2009-04-23 14:22:49 EDT (Thu, 23 Apr 2009)
@@ -0,0 +1,56 @@
+@echo off
+rem Copyright Christopher Schmidt 2009.
+rem Distributed under the Boost Software License, Version 1.0.
+rem (See accompanying file LICENSE_1_0.txt or copy at
+rem http://www.boost.org/LICENSE_1_0.txt)
+
+rem (re-)set environment variables
+set BOOST_ROOT=d:\projekte\libs\boost
+set BOOST_INCLUDES_PATH=D:\projekte\libs\boost\include\boost-1_38
+set HOME=
+
+rem call toolset specific procedure
+if "%1" == "conceptgcc" (
+ call :conceptgcc
+) else (
+ if "%1" == "gcc" (
+ call :gcc
+ ) else (
+ if "%1" == "msvc" (
+ call :msvc
+ ) else (
+ if "%1" == "" (
+ call :conceptgcc
+ ) else (
+ echo Unknown toolset '%1'
+ goto :eof
+ )
+ )
+ )
+)
+
+rem compile...
+z:\projekte\cl_link_frontend\tools\bjam --toolset=%TOOLSET% mini-fusion
+goto :eof
+
+:conceptgcc
+rem set HOME to the current path so bjam uses our custom user-config.jam with the custom invocation commands for ConceptGCC
+set HOME=.
+rem Add the workaround folder to the include paths so our workaround stl include files are found
+set CPLUS_INCLUDE_PATH=./workaround/conceptgcc:
+rem ConceptGCC needs a cygwin path
+set BOOST_INCLUDES_PATH=/cygdrive/d/projekte/libs/boost/include/boost-1_38
+
+set PATH=C:\cygwin\opt\conceptgcc-4.3.0-alpha-7\bin;C:\cygwin\bin;%PATH%
+set TOOLSET=gcc
+goto :eof
+
+:gcc
+set PATH=C:\MinGW\bin;%PATH%
+set TOOLSET=gcc
+goto :eof
+
+:msvc
+call "%VS90COMNTOOLS%..\..\VC\vcvarsall" x86
+set TOOLSET=msvc
+goto :eof
\ No newline at end of file

Added: sandbox/SOC/2009/fusion/mini-fusion/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/mini-fusion/Jamfile.v2 2009-04-23 14:22:49 EDT (Thu, 23 Apr 2009)
@@ -0,0 +1,7 @@
+# Copyright Christopher Schmidt 2009.
+# 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)
+
+exe mini-fusion
+ : [ glob *.cpp ] ;
\ No newline at end of file

Added: sandbox/SOC/2009/fusion/mini-fusion/test.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/mini-fusion/test.cpp 2009-04-23 14:22:49 EDT (Thu, 23 Apr 2009)
@@ -0,0 +1,290 @@
+// Copyright Christopher Schmidt 2009.
+// 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 <utility>
+#include <concepts>
+
+#include <boost/mpl/size_t.hpp>
+#include <boost/mpl/bool.hpp>
+
+namespace boost{namespace fusion{namespace gsoc{
+
+ namespace detail
+ {
+ template<class... Elements> class vector_impl;
+ template<> class vector_impl<>{};
+
+ template<class Head,class...Other>class vector_impl<Head,Other...> :
+ public vector_impl<Other...>
+ {
+ template<class...> friend class vector_impl;
+
+ private:
+ typedef vector_impl<Other...> base;
+
+ Head _element;
+
+ public:
+ vector_impl()
+ {
+ }
+
+ vector_impl(const vector_impl& other_impl):
+ base(other_impl),
+ _element(other_impl._element)
+ {
+ }
+
+ vector_impl(vector_impl&& other_impl):
+ base(std::move(other_impl)),
+ _element(std::move(other_impl._element))
+ {
+ }
+
+ template<class OtherHead,class... OtherElements>vector_impl(const OtherHead& other_head,const OtherElements&... other_elements):
+ base(other_elements...),
+ _element(other_head)
+ {
+ }
+
+ template<class OtherHead,class... OtherElements>vector_impl(OtherHead&& other_head,OtherElements&&... other_elements):
+ base(std::forward<OtherElements>(other_elements)...),
+ _element(std::forward<OtherHead>(other_head))
+ {
+ }
+
+ template<class OtherHead,class... OtherElements>vector_impl(const vector_impl<OtherHead,OtherElements...>& other_impl):
+ base(other_impl),
+ _element(other_impl._element)
+ {
+ }
+
+ template<class OtherHead,class... OtherElements>vector_impl(vector_impl<OtherHead,OtherElements...>&& other_impl):
+ base(std::move(other_impl)),
+ _element(std::move(other_impl._element))
+ {
+ }
+
+ void operator=(const vector_impl& other_impl)
+ {
+ _element=other_impl._element;
+ static_cast<base&>(*this)=other_impl;
+ }
+
+ void operator=(vector_impl&& other_impl)
+ {
+ _element=std::move(other_impl._element);
+ static_cast<base&>(*this)=std::move(other_impl);
+ }
+
+ template<class OtherHead,class... OtherElements>void operator=(const vector_impl<OtherHead,OtherElements...>& other_impl)
+ {
+ _element=other_impl._element;
+ static_cast<base&>(*this)=other_impl;
+ }
+
+ template<class OtherHead,class... OtherElements>void operator=(vector_impl<OtherHead,OtherElements...>&& other_impl)
+ {
+ _element=std::move(other_impl._element);
+ static_cast<base&>(*this)=std::move(other_impl);
+ }
+ };
+ }
+
+ template<class... Elements>class vector:
+ public detail::vector_impl<Elements...>
+ {
+ private:
+ typedef detail::vector_impl<Elements...> base;
+
+ public:
+ vector()
+ {
+ }
+
+ vector(const vector& other_vector):
+ base(other_vector)
+ {
+ }
+
+ vector(vector&& other_vector):
+ base(std::move(other_vector))
+ {
+ }
+
+ template<class... OtherElements> vector(const vector<OtherElements...>& other_vector):
+ base(other_vector)
+ {
+ }
+
+ template<class... OtherElements> vector(vector<OtherElements...>&& other_vector):
+ base(std::move(other_vector))
+ {
+ }
+
+ template<class... OtherElements> explicit vector(const OtherElements&... other_elements):
+ base(std::forward<OtherElements>(other_elements)...)
+ {
+ }
+
+ template<class... OtherElements> explicit vector(OtherElements&&... other_elements):
+ base(std::forward<OtherElements>(other_elements)...)
+ {
+ }
+
+ /*template<class OtherSequence> vector(OtherSequence&& other_sequence)
+ {
+ }
+
+ template<class OtherSequence> vector(const OtherSequence& other_sequence)
+ {
+ }*/
+
+ vector& operator=(const vector& other_vector)
+ {
+ static_cast<base&>(*this)=other_vector;
+ return *this;
+ }
+
+ vector& operator=(vector&& other_vector)
+ {
+ static_cast<base&>(*this)=std::move(other_vector);
+ return *this;
+ }
+ };
+
+ template<class Vector, std::size_t Index> class vector_iterator
+ {
+ public:
+ typedef mpl::size_t<Index> index;
+ typedef Vector vector;
+
+ private:
+ Vector& _vector;
+
+ public:
+ vector_iterator(Vector& vector):
+ _vector(vector)
+ {
+ }
+ };
+
+ namespace result_of
+ {
+ template<class Sequence>class size;
+ template<class... Elements>class size<vector<Elements...>>
+ {
+ public:
+ typedef mpl::size_t<sizeof...(Elements)> type;
+ };
+
+ template<class Sequence>class empty
+ {
+ public:
+ typedef mpl::bool_<!size<Sequence>::type::value> type;
+ };
+
+ template<class Sequence>class begin;
+ template<class... Elements>class begin<vector<Elements...>>
+ {
+ public:
+ typedef vector_iterator<vector<Elements...>,0> type;
+ };
+
+ template<class Sequence>class end;
+ template<class... Elements>class end<vector<Elements...>>
+ {
+ public:
+ typedef vector_iterator<vector<Elements...>,size<vector<Elements...>>::type::value> type;
+ };
+
+ template<class Sequence>class next;
+ template<class Vector,std::size_type Index>class next<vector_iterator<vector,Index>>
+ {
+ public:
+ typedef vector_iterator<Vector,Index+1> type;
+ };
+ }
+
+ template<class Sequence> typename result_of::size<Sequence>::type size(const Sequence&)
+ {
+ return typename result_of::size<Sequence>::type();
+ }
+
+ template<class Sequence> typename result_of::empty<Sequence>::type empty(const Sequence&)
+ {
+ return typename result_of::empty<Sequence>::type();
+ }
+
+ template<class Sequence> typename result_of::begin<Sequence>::type begin(Sequence& sequence)
+ {
+ return result_of::begin<Sequence>(sequence);
+ }
+
+ template<class Sequence> typename result_of::begin<Sequence const>::type begin(const Sequence& sequence)
+ {
+ return result_of::begin<const Sequence>(sequence);
+ }
+
+ template<class Sequence> typename result_of::end<Sequence>::type end(Sequence& sequence)
+ {
+ return result_of::end<Sequence>(sequence);
+ }
+
+ template<class Sequence> typename result_of::end<Sequence const>::type end(const Sequence& sequence)
+ {
+ return result_of::end<const Sequence>(sequence);
+ }
+}}}
+
+class copyable
+{
+//private:
+ //copyable(copyable&&);
+
+public:
+ copyable()
+ {
+ }
+ copyable(const copyable&)
+ {
+ }
+};
+
+class moveable
+{
+private:
+ moveable(const moveable&);
+
+public:
+ moveable()
+ {
+ }
+ moveable(moveable&&)
+ {
+ }
+};
+
+int main()
+{
+ namespace gsoc=boost::fusion::gsoc;
+ using namespace std;
+
+ gsoc::vector<int,float,char> a;
+ gsoc::vector<int,float,char> b(0,0,0);
+
+ a=b;
+ b=move(a);
+
+ gsoc::vector<moveable,copyable> c;
+ moveable ma;
+ copyable ca;
+ gsoc::vector<moveable,copyable> d(move(ma),move(ca));
+
+ //c=c;
+ //d=move(d);
+
+ return 0;
+}

Added: sandbox/SOC/2009/fusion/project-root.jam
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/project-root.jam 2009-04-23 14:22:49 EDT (Thu, 23 Apr 2009)
@@ -0,0 +1,13 @@
+# Copyright Christopher Schmidt 2009.
+# 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)
+
+import os ;
+local BOOST_INCLUDES_PATH = [ os.environ BOOST_INCLUDES_PATH ] ;
+
+project fusion
+ : requirements <include>$(BOOST_INCLUDES_PATH)
+ : build-dir ../bin
+ : default-build debug <link>shared <runtime-link>shared <threading>multi
+ ;

Added: sandbox/SOC/2009/fusion/user-config.jam
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/user-config.jam 2009-04-23 14:22:49 EDT (Thu, 23 Apr 2009)
@@ -0,0 +1,7 @@
+# Copyright Christopher Schmidt 2009.
+# 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)
+
+#custom invocation command for ConceptGCC as ConceptGCC does not offer the regular g++ executable
+using gcc : conceptgcc : "c++" ;

Added: sandbox/SOC/2009/fusion/workaround/conceptgcc/utility
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/workaround/conceptgcc/utility 2009-04-23 14:22:49 EDT (Thu, 23 Apr 2009)
@@ -0,0 +1,38 @@
+// Copyright Christopher Schmidt 2009.
+// 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)
+
+#pragma once
+
+#include <type_traits>
+#include_next <utility>
+
+namespace std
+{
+ namespace detail
+ {
+ //20.3.2...
+ template<class Type>struct identity
+ {
+ typedef Type type;
+ };
+ }
+
+ template<class Type> Type&& forward(typename detail::identity<Type>::type&& type)
+ {
+ return type;
+ }
+
+ template<class Type> typename remove_reference<Type>::type&& move(Type&& type)
+ {
+ return type;
+ }
+
+ template<class Type> void swap(Type& a, Type& b)
+ {
+ Type temp = move(a);
+ a = move(b);
+ b = move(temp);
+ }
+}
\ No newline at end of file


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