Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r82222 - in trunk: boost/icl boost/icl/concept boost/icl/detail libs/icl/test libs/icl/test/ex_boost_party_
From: afojgo_at_[hidden]
Date: 2012-12-27 13:49:13


Author: jofaber
Date: 2012-12-27 13:49:11 EST (Thu, 27 Dec 2012)
New Revision: 82222
URL: http://svn.boost.org/trac/boost/changeset/82222

Log:
Fixes for bug #7231 with clang 3.1 and later. Adding a test case.
Added:
   trunk/libs/icl/test/ex_boost_party_/
   trunk/libs/icl/test/ex_boost_party_/ex_boost_party.cpp (contents, props changed)
   trunk/libs/icl/test/ex_boost_party_/vc10_ex_boost_party.vcxproj (contents, props changed)
Text files modified:
   trunk/boost/icl/concept/element_map.hpp | 1 +
   trunk/boost/icl/detail/set_algo.hpp | 3 ---
   trunk/boost/icl/map.hpp | 2 +-
   trunk/boost/icl/set.hpp | 6 ++----
   trunk/libs/icl/test/Jamfile.v2 | 3 +++
   trunk/libs/icl/test/vc10_icl_fast_tests.sln | 6 ++++++
   6 files changed, 13 insertions(+), 8 deletions(-)

Modified: trunk/boost/icl/concept/element_map.hpp
==============================================================================
--- trunk/boost/icl/concept/element_map.hpp (original)
+++ trunk/boost/icl/concept/element_map.hpp 2012-12-27 13:49:11 EST (Thu, 27 Dec 2012)
@@ -11,6 +11,7 @@
 #include <boost/mpl/and.hpp>
 #include <boost/mpl/not.hpp>
 #include <boost/icl/detail/on_absorbtion.hpp>
+#include <boost/icl/type_traits/unit_element.hpp>
 #include <boost/icl/type_traits/is_total.hpp>
 #include <boost/icl/type_traits/absorbs_identities.hpp>
 #include <boost/icl/type_traits/is_associative_element_container.hpp>

Modified: trunk/boost/icl/detail/set_algo.hpp
==============================================================================
--- trunk/boost/icl/detail/set_algo.hpp (original)
+++ trunk/boost/icl/detail/set_algo.hpp 2012-12-27 13:49:11 EST (Thu, 27 Dec 2012)
@@ -11,10 +11,7 @@
 #define BOOST_ICL_SET_ALGO_HPP_JOFA_990225
 
 #include <boost/type_traits/remove_const.hpp>
-
 #include <boost/icl/detail/notate.hpp>
-#include <boost/icl/functors.hpp>
-
 #include <boost/icl/concept/container.hpp>
 #include <boost/icl/concept/set_value.hpp>
 #include <boost/icl/concept/map_value.hpp>

Modified: trunk/boost/icl/map.hpp
==============================================================================
--- trunk/boost/icl/map.hpp (original)
+++ trunk/boost/icl/map.hpp 2012-12-27 13:49:11 EST (Thu, 27 Dec 2012)
@@ -34,9 +34,9 @@
 #include <boost/icl/type_traits/is_element_container.hpp>
 #include <boost/icl/type_traits/has_inverse.hpp>
 #include <boost/icl/type_traits/to_string.hpp>
-#include <boost/icl/functors.hpp>
 
 #include <boost/icl/associative_element_container.hpp>
+#include <boost/icl/functors.hpp>
 
 namespace boost{namespace icl
 {

Modified: trunk/boost/icl/set.hpp
==============================================================================
--- trunk/boost/icl/set.hpp (original)
+++ trunk/boost/icl/set.hpp 2012-12-27 13:49:11 EST (Thu, 27 Dec 2012)
@@ -18,10 +18,8 @@
 # include <set>
 #endif
 
-#include <boost/icl/concept/associative_element_container.hpp>
-
-
-}} // namespace icl boost
+#include <boost/icl/associative_element_container.hpp>
+#include <boost/icl/functors.hpp>
 
 #endif // BOOST_ICL_SET_HPP_JOFA_070519
 

Modified: trunk/libs/icl/test/Jamfile.v2
==============================================================================
--- trunk/libs/icl/test/Jamfile.v2 (original)
+++ trunk/libs/icl/test/Jamfile.v2 2012-12-27 13:49:11 EST (Thu, 27 Dec 2012)
@@ -78,6 +78,9 @@
       [ run cmp_clang_ttp_passing_/cmp_clang_ttp_passing.cpp ]
       [ run cmp_clang_ttp_passing2_/cmp_clang_ttp_passing2.cpp ]
       
+ # Examples ---------------------------------------------------------------
+ [ run ex_boost_party_/ex_boost_party.cpp ]
+
       # Ad hoc -----------------------------------------------------------------
       #[ run test_casual_/test_casual.cpp ]
 

Added: trunk/libs/icl/test/ex_boost_party_/ex_boost_party.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/icl/test/ex_boost_party_/ex_boost_party.cpp 2012-12-27 13:49:11 EST (Thu, 27 Dec 2012)
@@ -0,0 +1,128 @@
+/*-----------------------------------------------------------------------------+
+Copyright (c) 2008-2009: Joachim Faulhaber
++------------------------------------------------------------------------------+
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENCE.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
++-----------------------------------------------------------------------------*/
+#define BOOST_TEST_MODULE icl::example_boost_party unit test
+
+#include <libs/icl/test/disable_test_warnings.hpp>
+#include "../unit_test_unwarned.hpp"
+
+//------------------------------------------------------------------------------
+// begin example code. return value added to function boost_party
+//------------------------------------------------------------------------------
+#include <boost/icl/ptime.hpp>
+#include <iostream>
+#include <boost/icl/interval_map.hpp>
+
+using namespace std;
+using namespace boost::posix_time;
+using namespace boost::icl;
+
+// Type set<string> collects the names of party guests. Since std::set is
+// a model of the itl's set concept, the concept provides an operator +=
+// that performs a set union on overlap of intervals.
+typedef std::set<string> GuestSetT;
+
+interval_map<ptime, GuestSetT> boost_party()
+{
+ GuestSetT mary_harry;
+ mary_harry.insert("Mary");
+ mary_harry.insert("Harry");
+
+ GuestSetT diana_susan;
+ diana_susan.insert("Diana");
+ diana_susan.insert("Susan");
+
+ GuestSetT peter;
+ peter.insert("Peter");
+
+ // A party is an interval map that maps time intervals to sets of guests
+ interval_map<ptime, GuestSetT> party;
+
+ party.add( // add and element
+ make_pair(
+ interval<ptime>::right_open(
+ time_from_string("2008-05-20 19:30"),
+ time_from_string("2008-05-20 23:00")),
+ mary_harry));
+
+ party += // element addition can also be done via operator +=
+ make_pair(
+ interval<ptime>::right_open(
+ time_from_string("2008-05-20 20:10"),
+ time_from_string("2008-05-21 00:00")),
+ diana_susan);
+
+ party +=
+ make_pair(
+ interval<ptime>::right_open(
+ time_from_string("2008-05-20 22:15"),
+ time_from_string("2008-05-21 00:30")),
+ peter);
+
+
+ interval_map<ptime, GuestSetT>::iterator it = party.begin();
+ cout << "----- History of party guests -------------------------\n";
+ while(it != party.end())
+ {
+ interval<ptime>::type when = it->first;
+ // Who is at the party within the time interval 'when' ?
+ GuestSetT who = (*it++).second;
+ cout << when << ": " << who << endl;
+ }
+
+ return party;
+}
+//------------------------------------------------------------------------------
+// end example code
+//------------------------------------------------------------------------------
+
+typedef interval_map<ptime, GuestSetT> PartyHistory;
+
+typedef PartyHistory::segment_type SegmentT;
+
+SegmentT episode(const char* from, const char* to, GuestSetT guests)
+{
+ return make_pair( interval<ptime>
+ ::right_open( time_from_string(from)
+ , time_from_string(to) )
+ , guests);
+}
+
+PartyHistory check_party()
+{
+ GuestSetT mary_harry;
+ mary_harry.insert("Mary");
+ mary_harry.insert("Harry");
+
+ GuestSetT diana_susan;
+ diana_susan.insert("Diana");
+ diana_susan.insert("Susan");
+
+ GuestSetT peter;
+ peter.insert("Peter");
+
+ GuestSetT Diana_Harry_Mary_Susan = mary_harry + diana_susan;
+ GuestSetT Diana_Harry_Mary_Peter_Susan = Diana_Harry_Mary_Susan + peter;
+ GuestSetT Diana_Peter_Susan = Diana_Harry_Mary_Peter_Susan - mary_harry;
+
+ PartyHistory party;
+
+ party += episode("2008-05-20 19:30", "2008-05-20 20:10", mary_harry);
+ party += episode("2008-05-20 20:10", "2008-05-20 22:15", Diana_Harry_Mary_Susan);
+ party += episode("2008-05-20 22:15", "2008-05-20 23:00", Diana_Harry_Mary_Peter_Susan);
+ party += episode("2008-05-20 23:00", "2008-05-21 00:00", Diana_Peter_Susan);
+ party += episode("2008-05-21 00:00", "2008-05-21 00:30", peter);
+
+ return party;
+}
+
+BOOST_AUTO_TEST_CASE(icl_example_boost_party)
+{
+ BOOST_CHECK_EQUAL(boost_party(), check_party());
+}
+
+

Added: trunk/libs/icl/test/ex_boost_party_/vc10_ex_boost_party.vcxproj
==============================================================================
--- (empty file)
+++ trunk/libs/icl/test/ex_boost_party_/vc10_ex_boost_party.vcxproj 2012-12-27 13:49:11 EST (Thu, 27 Dec 2012)
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{EE61B7EF-EC45-4165-EC01-FD5B8D5A9FA0}</ProjectGuid>
+ <RootNamespace>Ex_boost_party</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../../../../bin/debug/\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../../../../bin/obj/$(ProjectName)/debug/\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../../../../bin/release/\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../../../../bin/obj/$(ProjectName)/release/\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>../../../../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <OutputFile>../../../../bin/debug/$(ProjectName).exe</OutputFile>
+ <AdditionalLibraryDirectories>../../../../lib; ../../../../stage/lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>../../../../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level4</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <OutputFile>../../../../bin/release/$(ProjectName).exe</OutputFile>
+ <AdditionalLibraryDirectories>../../../../lib; ../../../../stage/lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="ex_boost_party.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\test_interval_map_shared.hpp" />
+ <ClInclude Include="..\test_type_lists.hpp" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file

Modified: trunk/libs/icl/test/vc10_icl_fast_tests.sln
==============================================================================
--- trunk/libs/icl/test/vc10_icl_fast_tests.sln (original)
+++ trunk/libs/icl/test/vc10_icl_fast_tests.sln 2012-12-27 13:49:11 EST (Thu, 27 Dec 2012)
@@ -67,6 +67,8 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vc10_test_casual", "test_casual_\vc10_test_casual.vcxproj", "{EE61B7EF-EC45-4165-8B49-FD5B8D3A9FA0}"
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vc10_ex_boost_party", "ex_boost_party_\vc10_ex_boost_party.vcxproj", "{EE61B7EF-EC45-4165-EC01-FD5B8D5A9FA0}"
+EndProject
 Global
         GlobalSection(SolutionConfigurationPlatforms) = preSolution
                 Debug|Win32 = Debug|Win32
@@ -205,6 +207,10 @@
                 {EE61B7EF-EC45-4165-8B49-FD5B8D3A9FA0}.Debug|Win32.Build.0 = Debug|Win32
                 {EE61B7EF-EC45-4165-8B49-FD5B8D3A9FA0}.Release|Win32.ActiveCfg = Release|Win32
                 {EE61B7EF-EC45-4165-8B49-FD5B8D3A9FA0}.Release|Win32.Build.0 = Release|Win32
+ {EE61B7EF-EC45-4165-EC01-FD5B8D5A9FA0}.Debug|Win32.ActiveCfg = Debug|Win32
+ {EE61B7EF-EC45-4165-EC01-FD5B8D5A9FA0}.Debug|Win32.Build.0 = Debug|Win32
+ {EE61B7EF-EC45-4165-EC01-FD5B8D5A9FA0}.Release|Win32.ActiveCfg = Release|Win32
+ {EE61B7EF-EC45-4165-EC01-FD5B8D5A9FA0}.Release|Win32.Build.0 = Release|Win32
         EndGlobalSection
         GlobalSection(SolutionProperties) = preSolution
                 HideSolutionNode = FALSE


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