Browse code

Updating pwiz to 3_0_21263

Steffen Neumann authored on 23/09/2021 12:34:25
Showing 1 changed files
1 1
new file mode 100755
... ...
@@ -0,0 +1,20 @@
1
+//  boost cast.hpp header file
2
+//
3
+//  (C) Copyright Antony Polukhin 2014.
4
+//
5
+//  Distributed under the Boost
6
+//  Software License, Version 1.0. (See accompanying file
7
+//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8
+//
9
+//  See http://www.boost.org/libs/conversion for Documentation.
10
+
11
+// This is a DEPRECATED header file!
12
+// Use <boost/polymorphic_cast.hpp> or <boost/numeric/conversion/cast.hpp> instead
13
+
14
+#ifndef BOOST_CAST_HPP
15
+#define BOOST_CAST_HPP
16
+
17
+# include <boost/polymorphic_cast.hpp>
18
+# include <boost/numeric/conversion/cast.hpp>
19
+
20
+#endif  // BOOST_CAST_HPP
Browse code

drop old boost

From: Steffen Neumann <sneumann@ipb-halle.de>

git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/mzR@125184 bc3139a8-67e5-0310-9ffc-ced21a209358

l.gatto authored on 15/12/2016 10:41:45
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,107 +0,0 @@
1
-//  boost cast.hpp header file  ----------------------------------------------//
2
-
3
-//  (C) Copyright Kevlin Henney and Dave Abrahams 1999.
4
-//  Distributed under the Boost
5
-//  Software License, Version 1.0. (See accompanying file
6
-//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7
-
8
-//  See http://www.boost.org/libs/conversion for Documentation.
9
-
10
-//  Revision History
11
-//  23 JUn 05  numeric_cast removed and redirected to the new verion (Fernando Cacciola)
12
-//  02 Apr 01  Removed BOOST_NO_LIMITS workarounds and included
13
-//             <boost/limits.hpp> instead (the workaround did not
14
-//             actually compile when BOOST_NO_LIMITS was defined in
15
-//             any case, so we loose nothing). (John Maddock)
16
-//  21 Jan 01  Undid a bug I introduced yesterday. numeric_cast<> never
17
-//             worked with stock GCC; trying to get it to do that broke
18
-//             vc-stlport.
19
-//  20 Jan 01  Moved BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS to config.hpp.
20
-//             Removed unused BOOST_EXPLICIT_TARGET macro. Moved
21
-//             boost::detail::type to boost/type.hpp. Made it compile with
22
-//             stock gcc again (Dave Abrahams)
23
-//  29 Nov 00  Remove nested namespace cast, cleanup spacing before Formal
24
-//             Review (Beman Dawes)
25
-//  19 Oct 00  Fix numeric_cast for floating-point types (Dave Abrahams)
26
-//  15 Jul 00  Suppress numeric_cast warnings for GCC, Borland and MSVC
27
-//             (Dave Abrahams)
28
-//  30 Jun 00  More MSVC6 wordarounds.  See comments below.  (Dave Abrahams)
29
-//  28 Jun 00  Removed implicit_cast<>.  See comment below. (Beman Dawes)
30
-//  27 Jun 00  More MSVC6 workarounds
31
-//  15 Jun 00  Add workarounds for MSVC6
32
-//   2 Feb 00  Remove bad_numeric_cast ";" syntax error (Doncho Angelov)
33
-//  26 Jan 00  Add missing throw() to bad_numeric_cast::what(0 (Adam Levar)
34
-//  29 Dec 99  Change using declarations so usages in other namespaces work
35
-//             correctly (Dave Abrahams)
36
-//  23 Sep 99  Change polymorphic_downcast assert to also detect M.I. errors
37
-//             as suggested Darin Adler and improved by Valentin Bonnard.
38
-//   2 Sep 99  Remove controversial asserts, simplify, rename.
39
-//  30 Aug 99  Move to cast.hpp, replace value_cast with numeric_cast,
40
-//             place in nested namespace.
41
-//   3 Aug 99  Initial version
42
-
43
-#ifndef BOOST_CAST_HPP
44
-#define BOOST_CAST_HPP
45
-
46
-# include <boost/config.hpp>
47
-# include <boost/assert.hpp>
48
-# include <typeinfo>
49
-# include <boost/type.hpp>
50
-# include <boost/limits.hpp>
51
-# include <boost/detail/select_type.hpp>
52
-
53
-//  It has been demonstrated numerous times that MSVC 6.0 fails silently at link
54
-//  time if you use a template function which has template parameters that don't
55
-//  appear in the function's argument list.
56
-//
57
-//  TODO: Add this to config.hpp?
58
-# if defined(BOOST_MSVC) && BOOST_MSVC < 1300
59
-#  define BOOST_EXPLICIT_DEFAULT_TARGET , ::boost::type<Target>* = 0
60
-# else
61
-#  define BOOST_EXPLICIT_DEFAULT_TARGET
62
-# endif
63
-
64
-namespace boost
65
-{
66
-//  See the documentation for descriptions of how to choose between
67
-//  static_cast<>, dynamic_cast<>, polymorphic_cast<> and polymorphic_downcast<>
68
-
69
-//  polymorphic_cast  --------------------------------------------------------//
70
-
71
-    //  Runtime checked polymorphic downcasts and crosscasts.
72
-    //  Suggested in The C++ Programming Language, 3rd Ed, Bjarne Stroustrup,
73
-    //  section 15.8 exercise 1, page 425.
74
-
75
-    template <class Target, class Source>
76
-    inline Target polymorphic_cast(Source* x BOOST_EXPLICIT_DEFAULT_TARGET)
77
-    {
78
-        Target tmp = dynamic_cast<Target>(x);
79
-        if ( tmp == 0 ) throw std::bad_cast();
80
-        return tmp;
81
-    }
82
-
83
-//  polymorphic_downcast  ----------------------------------------------------//
84
-
85
-    //  BOOST_ASSERT() checked polymorphic downcast.  Crosscasts prohibited.
86
-
87
-    //  WARNING: Because this cast uses BOOST_ASSERT(), it violates
88
-    //  the One Definition Rule if used in multiple translation units
89
-    //  where BOOST_DISABLE_ASSERTS, BOOST_ENABLE_ASSERT_HANDLER
90
-    //  NDEBUG are defined inconsistently.
91
-
92
-    //  Contributed by Dave Abrahams
93
-
94
-    template <class Target, class Source>
95
-    inline Target polymorphic_downcast(Source* x BOOST_EXPLICIT_DEFAULT_TARGET)
96
-    {
97
-        BOOST_ASSERT( dynamic_cast<Target>(x) == x );  // detect logic error
98
-        return static_cast<Target>(x);
99
-    }
100
-
101
-#  undef BOOST_EXPLICIT_DEFAULT_TARGET
102
-
103
-} // namespace boost
104
-
105
-# include <boost/numeric/conversion/cast.hpp>
106
-
107
-#endif  // BOOST_CAST_HPP
Browse code

checkout latest pwiz, ammend Makevars

From: Laurent <lg390@cam.ac.uk>

git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/mzR@125180 bc3139a8-67e5-0310-9ffc-ced21a209358

l.gatto authored on 15/12/2016 10:21:41
Showing 1 changed files
... ...
@@ -1,20 +1,107 @@
1
-//  boost cast.hpp header file
2
-//
3
-//  (C) Copyright Antony Polukhin 2014.
4
-//
5
-//  Distributed under the Boost
6
-//  Software License, Version 1.0. (See accompanying file
7
-//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8
-//
9
-//  See http://www.boost.org/libs/conversion for Documentation.
10
-
11
-// This is a DEPRECATED header file!
12
-// Use <boost/polymorphic_cast.hpp> or <boost/numeric/conversion/cast.hpp> instead
13
-
14
-#ifndef BOOST_CAST_HPP
15
-#define BOOST_CAST_HPP
16
-
17
-# include <boost/polymorphic_cast.hpp>
18
-# include <boost/numeric/conversion/cast.hpp>
19
-
20
-#endif  // BOOST_CAST_HPP
1
+//  boost cast.hpp header file  ----------------------------------------------//
2
+
3
+//  (C) Copyright Kevlin Henney and Dave Abrahams 1999.
4
+//  Distributed under the Boost
5
+//  Software License, Version 1.0. (See accompanying file
6
+//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7
+
8
+//  See http://www.boost.org/libs/conversion for Documentation.
9
+
10
+//  Revision History
11
+//  23 JUn 05  numeric_cast removed and redirected to the new verion (Fernando Cacciola)
12
+//  02 Apr 01  Removed BOOST_NO_LIMITS workarounds and included
13
+//             <boost/limits.hpp> instead (the workaround did not
14
+//             actually compile when BOOST_NO_LIMITS was defined in
15
+//             any case, so we loose nothing). (John Maddock)
16
+//  21 Jan 01  Undid a bug I introduced yesterday. numeric_cast<> never
17
+//             worked with stock GCC; trying to get it to do that broke
18
+//             vc-stlport.
19
+//  20 Jan 01  Moved BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS to config.hpp.
20
+//             Removed unused BOOST_EXPLICIT_TARGET macro. Moved
21
+//             boost::detail::type to boost/type.hpp. Made it compile with
22
+//             stock gcc again (Dave Abrahams)
23
+//  29 Nov 00  Remove nested namespace cast, cleanup spacing before Formal
24
+//             Review (Beman Dawes)
25
+//  19 Oct 00  Fix numeric_cast for floating-point types (Dave Abrahams)
26
+//  15 Jul 00  Suppress numeric_cast warnings for GCC, Borland and MSVC
27
+//             (Dave Abrahams)
28
+//  30 Jun 00  More MSVC6 wordarounds.  See comments below.  (Dave Abrahams)
29
+//  28 Jun 00  Removed implicit_cast<>.  See comment below. (Beman Dawes)
30
+//  27 Jun 00  More MSVC6 workarounds
31
+//  15 Jun 00  Add workarounds for MSVC6
32
+//   2 Feb 00  Remove bad_numeric_cast ";" syntax error (Doncho Angelov)
33
+//  26 Jan 00  Add missing throw() to bad_numeric_cast::what(0 (Adam Levar)
34
+//  29 Dec 99  Change using declarations so usages in other namespaces work
35
+//             correctly (Dave Abrahams)
36
+//  23 Sep 99  Change polymorphic_downcast assert to also detect M.I. errors
37
+//             as suggested Darin Adler and improved by Valentin Bonnard.
38
+//   2 Sep 99  Remove controversial asserts, simplify, rename.
39
+//  30 Aug 99  Move to cast.hpp, replace value_cast with numeric_cast,
40
+//             place in nested namespace.
41
+//   3 Aug 99  Initial version
42
+
43
+#ifndef BOOST_CAST_HPP
44
+#define BOOST_CAST_HPP
45
+
46
+# include <boost/config.hpp>
47
+# include <boost/assert.hpp>
48
+# include <typeinfo>
49
+# include <boost/type.hpp>
50
+# include <boost/limits.hpp>
51
+# include <boost/detail/select_type.hpp>
52
+
53
+//  It has been demonstrated numerous times that MSVC 6.0 fails silently at link
54
+//  time if you use a template function which has template parameters that don't
55
+//  appear in the function's argument list.
56
+//
57
+//  TODO: Add this to config.hpp?
58
+# if defined(BOOST_MSVC) && BOOST_MSVC < 1300
59
+#  define BOOST_EXPLICIT_DEFAULT_TARGET , ::boost::type<Target>* = 0
60
+# else
61
+#  define BOOST_EXPLICIT_DEFAULT_TARGET
62
+# endif
63
+
64
+namespace boost
65
+{
66
+//  See the documentation for descriptions of how to choose between
67
+//  static_cast<>, dynamic_cast<>, polymorphic_cast<> and polymorphic_downcast<>
68
+
69
+//  polymorphic_cast  --------------------------------------------------------//
70
+
71
+    //  Runtime checked polymorphic downcasts and crosscasts.
72
+    //  Suggested in The C++ Programming Language, 3rd Ed, Bjarne Stroustrup,
73
+    //  section 15.8 exercise 1, page 425.
74
+
75
+    template <class Target, class Source>
76
+    inline Target polymorphic_cast(Source* x BOOST_EXPLICIT_DEFAULT_TARGET)
77
+    {
78
+        Target tmp = dynamic_cast<Target>(x);
79
+        if ( tmp == 0 ) throw std::bad_cast();
80
+        return tmp;
81
+    }
82
+
83
+//  polymorphic_downcast  ----------------------------------------------------//
84
+
85
+    //  BOOST_ASSERT() checked polymorphic downcast.  Crosscasts prohibited.
86
+
87
+    //  WARNING: Because this cast uses BOOST_ASSERT(), it violates
88
+    //  the One Definition Rule if used in multiple translation units
89
+    //  where BOOST_DISABLE_ASSERTS, BOOST_ENABLE_ASSERT_HANDLER
90
+    //  NDEBUG are defined inconsistently.
91
+
92
+    //  Contributed by Dave Abrahams
93
+
94
+    template <class Target, class Source>
95
+    inline Target polymorphic_downcast(Source* x BOOST_EXPLICIT_DEFAULT_TARGET)
96
+    {
97
+        BOOST_ASSERT( dynamic_cast<Target>(x) == x );  // detect logic error
98
+        return static_cast<Target>(x);
99
+    }
100
+
101
+#  undef BOOST_EXPLICIT_DEFAULT_TARGET
102
+
103
+} // namespace boost
104
+
105
+# include <boost/numeric/conversion/cast.hpp>
106
+
107
+#endif  // BOOST_CAST_HPP
Browse code

Commit made by the Bioconductor Git-SVN bridge.

Commit id: 0b3d4d9bb71e3ca5891b777610fc8dec103a6d61

Bumped version after KK's updates


Commit id: 9e04409b64757a177893d56c0300904f31945cb1

modified: src/pwiz/data/common/BinaryIndexStream.cpp modified: src/win/i386/libpwiz.a modified: src/win/x64/libpwiz.a


Commit id: f16b04258dc20bf3315beac99708e11728cfc12b

update precompiled lib for windows


Commit id: 5d56197f1148378d92e89b2d0a167e18c4b7ab2e

Bump version, tame .Rbuildignore


Commit id: 432da5bd294c9b87f7761e15bc814c3785c21abf

Merge remote-tracking branch 'origin/boost_159'


Commit id: 92be978bf72d90c2222a19ddf365f6d1acc9f20d

upadte Makevars


Commit id: ae75037a780cead56c4d20bedf822c94fb413677

upgrade to boost 1.5.9



git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/mzR@110126 bc3139a8-67e5-0310-9ffc-ced21a209358

s.neumann authored on 01/11/2015 22:33:47
Showing 1 changed files
... ...
@@ -1,107 +1,20 @@
1
-//  boost cast.hpp header file  ----------------------------------------------//
2
-
3
-//  (C) Copyright Kevlin Henney and Dave Abrahams 1999.
4
-//  Distributed under the Boost
5
-//  Software License, Version 1.0. (See accompanying file
6
-//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7
-
8
-//  See http://www.boost.org/libs/conversion for Documentation.
9
-
10
-//  Revision History
11
-//  23 JUn 05  numeric_cast removed and redirected to the new verion (Fernando Cacciola)
12
-//  02 Apr 01  Removed BOOST_NO_LIMITS workarounds and included
13
-//             <boost/limits.hpp> instead (the workaround did not
14
-//             actually compile when BOOST_NO_LIMITS was defined in
15
-//             any case, so we loose nothing). (John Maddock)
16
-//  21 Jan 01  Undid a bug I introduced yesterday. numeric_cast<> never
17
-//             worked with stock GCC; trying to get it to do that broke
18
-//             vc-stlport.
19
-//  20 Jan 01  Moved BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS to config.hpp.
20
-//             Removed unused BOOST_EXPLICIT_TARGET macro. Moved
21
-//             boost::detail::type to boost/type.hpp. Made it compile with
22
-//             stock gcc again (Dave Abrahams)
23
-//  29 Nov 00  Remove nested namespace cast, cleanup spacing before Formal
24
-//             Review (Beman Dawes)
25
-//  19 Oct 00  Fix numeric_cast for floating-point types (Dave Abrahams)
26
-//  15 Jul 00  Suppress numeric_cast warnings for GCC, Borland and MSVC
27
-//             (Dave Abrahams)
28
-//  30 Jun 00  More MSVC6 wordarounds.  See comments below.  (Dave Abrahams)
29
-//  28 Jun 00  Removed implicit_cast<>.  See comment below. (Beman Dawes)
30
-//  27 Jun 00  More MSVC6 workarounds
31
-//  15 Jun 00  Add workarounds for MSVC6
32
-//   2 Feb 00  Remove bad_numeric_cast ";" syntax error (Doncho Angelov)
33
-//  26 Jan 00  Add missing throw() to bad_numeric_cast::what(0 (Adam Levar)
34
-//  29 Dec 99  Change using declarations so usages in other namespaces work
35
-//             correctly (Dave Abrahams)
36
-//  23 Sep 99  Change polymorphic_downcast assert to also detect M.I. errors
37
-//             as suggested Darin Adler and improved by Valentin Bonnard.
38
-//   2 Sep 99  Remove controversial asserts, simplify, rename.
39
-//  30 Aug 99  Move to cast.hpp, replace value_cast with numeric_cast,
40
-//             place in nested namespace.
41
-//   3 Aug 99  Initial version
42
-
43
-#ifndef BOOST_CAST_HPP
44
-#define BOOST_CAST_HPP
45
-
46
-# include <boost/config.hpp>
47
-# include <boost/assert.hpp>
48
-# include <typeinfo>
49
-# include <boost/type.hpp>
50
-# include <boost/limits.hpp>
51
-# include <boost/detail/select_type.hpp>
52
-
53
-//  It has been demonstrated numerous times that MSVC 6.0 fails silently at link
54
-//  time if you use a template function which has template parameters that don't
55
-//  appear in the function's argument list.
56
-//
57
-//  TODO: Add this to config.hpp?
58
-# if defined(BOOST_MSVC) && BOOST_MSVC < 1300
59
-#  define BOOST_EXPLICIT_DEFAULT_TARGET , ::boost::type<Target>* = 0
60
-# else
61
-#  define BOOST_EXPLICIT_DEFAULT_TARGET
62
-# endif
63
-
64
-namespace boost
65
-{
66
-//  See the documentation for descriptions of how to choose between
67
-//  static_cast<>, dynamic_cast<>, polymorphic_cast<> and polymorphic_downcast<>
68
-
69
-//  polymorphic_cast  --------------------------------------------------------//
70
-
71
-    //  Runtime checked polymorphic downcasts and crosscasts.
72
-    //  Suggested in The C++ Programming Language, 3rd Ed, Bjarne Stroustrup,
73
-    //  section 15.8 exercise 1, page 425.
74
-
75
-    template <class Target, class Source>
76
-    inline Target polymorphic_cast(Source* x BOOST_EXPLICIT_DEFAULT_TARGET)
77
-    {
78
-        Target tmp = dynamic_cast<Target>(x);
79
-        if ( tmp == 0 ) throw std::bad_cast();
80
-        return tmp;
81
-    }
82
-
83
-//  polymorphic_downcast  ----------------------------------------------------//
84
-
85
-    //  BOOST_ASSERT() checked polymorphic downcast.  Crosscasts prohibited.
86
-
87
-    //  WARNING: Because this cast uses BOOST_ASSERT(), it violates
88
-    //  the One Definition Rule if used in multiple translation units
89
-    //  where BOOST_DISABLE_ASSERTS, BOOST_ENABLE_ASSERT_HANDLER
90
-    //  NDEBUG are defined inconsistently.
91
-
92
-    //  Contributed by Dave Abrahams
93
-
94
-    template <class Target, class Source>
95
-    inline Target polymorphic_downcast(Source* x BOOST_EXPLICIT_DEFAULT_TARGET)
96
-    {
97
-        BOOST_ASSERT( dynamic_cast<Target>(x) == x );  // detect logic error
98
-        return static_cast<Target>(x);
99
-    }
100
-
101
-#  undef BOOST_EXPLICIT_DEFAULT_TARGET
102
-
103
-} // namespace boost
104
-
105
-# include <boost/numeric/conversion/cast.hpp>
106
-
107
-#endif  // BOOST_CAST_HPP
1
+//  boost cast.hpp header file
2
+//
3
+//  (C) Copyright Antony Polukhin 2014.
4
+//
5
+//  Distributed under the Boost
6
+//  Software License, Version 1.0. (See accompanying file
7
+//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8
+//
9
+//  See http://www.boost.org/libs/conversion for Documentation.
10
+
11
+// This is a DEPRECATED header file!
12
+// Use <boost/polymorphic_cast.hpp> or <boost/numeric/conversion/cast.hpp> instead
13
+
14
+#ifndef BOOST_CAST_HPP
15
+#define BOOST_CAST_HPP
16
+
17
+# include <boost/polymorphic_cast.hpp>
18
+# include <boost/numeric/conversion/cast.hpp>
19
+
20
+#endif  // BOOST_CAST_HPP
Browse code

Added the mzR package to the repository.

git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/mzR@57456 bc3139a8-67e5-0310-9ffc-ced21a209358

c.wong authored on 15/08/2011 19:53:29
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,107 @@
1
+//  boost cast.hpp header file  ----------------------------------------------//
2
+
3
+//  (C) Copyright Kevlin Henney and Dave Abrahams 1999.
4
+//  Distributed under the Boost
5
+//  Software License, Version 1.0. (See accompanying file
6
+//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7
+
8
+//  See http://www.boost.org/libs/conversion for Documentation.
9
+
10
+//  Revision History
11
+//  23 JUn 05  numeric_cast removed and redirected to the new verion (Fernando Cacciola)
12
+//  02 Apr 01  Removed BOOST_NO_LIMITS workarounds and included
13
+//             <boost/limits.hpp> instead (the workaround did not
14
+//             actually compile when BOOST_NO_LIMITS was defined in
15
+//             any case, so we loose nothing). (John Maddock)
16
+//  21 Jan 01  Undid a bug I introduced yesterday. numeric_cast<> never
17
+//             worked with stock GCC; trying to get it to do that broke
18
+//             vc-stlport.
19
+//  20 Jan 01  Moved BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS to config.hpp.
20
+//             Removed unused BOOST_EXPLICIT_TARGET macro. Moved
21
+//             boost::detail::type to boost/type.hpp. Made it compile with
22
+//             stock gcc again (Dave Abrahams)
23
+//  29 Nov 00  Remove nested namespace cast, cleanup spacing before Formal
24
+//             Review (Beman Dawes)
25
+//  19 Oct 00  Fix numeric_cast for floating-point types (Dave Abrahams)
26
+//  15 Jul 00  Suppress numeric_cast warnings for GCC, Borland and MSVC
27
+//             (Dave Abrahams)
28
+//  30 Jun 00  More MSVC6 wordarounds.  See comments below.  (Dave Abrahams)
29
+//  28 Jun 00  Removed implicit_cast<>.  See comment below. (Beman Dawes)
30
+//  27 Jun 00  More MSVC6 workarounds
31
+//  15 Jun 00  Add workarounds for MSVC6
32
+//   2 Feb 00  Remove bad_numeric_cast ";" syntax error (Doncho Angelov)
33
+//  26 Jan 00  Add missing throw() to bad_numeric_cast::what(0 (Adam Levar)
34
+//  29 Dec 99  Change using declarations so usages in other namespaces work
35
+//             correctly (Dave Abrahams)
36
+//  23 Sep 99  Change polymorphic_downcast assert to also detect M.I. errors
37
+//             as suggested Darin Adler and improved by Valentin Bonnard.
38
+//   2 Sep 99  Remove controversial asserts, simplify, rename.
39
+//  30 Aug 99  Move to cast.hpp, replace value_cast with numeric_cast,
40
+//             place in nested namespace.
41
+//   3 Aug 99  Initial version
42
+
43
+#ifndef BOOST_CAST_HPP
44
+#define BOOST_CAST_HPP
45
+
46
+# include <boost/config.hpp>
47
+# include <boost/assert.hpp>
48
+# include <typeinfo>
49
+# include <boost/type.hpp>
50
+# include <boost/limits.hpp>
51
+# include <boost/detail/select_type.hpp>
52
+
53
+//  It has been demonstrated numerous times that MSVC 6.0 fails silently at link
54
+//  time if you use a template function which has template parameters that don't
55
+//  appear in the function's argument list.
56
+//
57
+//  TODO: Add this to config.hpp?
58
+# if defined(BOOST_MSVC) && BOOST_MSVC < 1300
59
+#  define BOOST_EXPLICIT_DEFAULT_TARGET , ::boost::type<Target>* = 0
60
+# else
61
+#  define BOOST_EXPLICIT_DEFAULT_TARGET
62
+# endif
63
+
64
+namespace boost
65
+{
66
+//  See the documentation for descriptions of how to choose between
67
+//  static_cast<>, dynamic_cast<>, polymorphic_cast<> and polymorphic_downcast<>
68
+
69
+//  polymorphic_cast  --------------------------------------------------------//
70
+
71
+    //  Runtime checked polymorphic downcasts and crosscasts.
72
+    //  Suggested in The C++ Programming Language, 3rd Ed, Bjarne Stroustrup,
73
+    //  section 15.8 exercise 1, page 425.
74
+
75
+    template <class Target, class Source>
76
+    inline Target polymorphic_cast(Source* x BOOST_EXPLICIT_DEFAULT_TARGET)
77
+    {
78
+        Target tmp = dynamic_cast<Target>(x);
79
+        if ( tmp == 0 ) throw std::bad_cast();
80
+        return tmp;
81
+    }
82
+
83
+//  polymorphic_downcast  ----------------------------------------------------//
84
+
85
+    //  BOOST_ASSERT() checked polymorphic downcast.  Crosscasts prohibited.
86
+
87
+    //  WARNING: Because this cast uses BOOST_ASSERT(), it violates
88
+    //  the One Definition Rule if used in multiple translation units
89
+    //  where BOOST_DISABLE_ASSERTS, BOOST_ENABLE_ASSERT_HANDLER
90
+    //  NDEBUG are defined inconsistently.
91
+
92
+    //  Contributed by Dave Abrahams
93
+
94
+    template <class Target, class Source>
95
+    inline Target polymorphic_downcast(Source* x BOOST_EXPLICIT_DEFAULT_TARGET)
96
+    {
97
+        BOOST_ASSERT( dynamic_cast<Target>(x) == x );  // detect logic error
98
+        return static_cast<Target>(x);
99
+    }
100
+
101
+#  undef BOOST_EXPLICIT_DEFAULT_TARGET
102
+
103
+} // namespace boost
104
+
105
+# include <boost/numeric/conversion/cast.hpp>
106
+
107
+#endif  // BOOST_CAST_HPP