Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Upgrade to Boost 1.51.0 and include boost lambda and boost foreach

  • Loading branch information...
commit 5f3674064415eadb97c6f25d75993118248938f4 1 parent 19f23d9
@FooBarWidget FooBarWidget authored
Showing with 24,651 additions and 1,615 deletions.
  1. +2 −2 build/common_library.rb
  2. +18 −7 dev/copy_boost_headers.rb
  3. +181 −0 ext/boost/aligned_storage.hpp
  4. +446 −0 ext/boost/array.hpp
  5. +331 −0 ext/boost/cerrno.hpp
  6. +36 −0 ext/boost/chrono/ceil.hpp
  7. +25 −0 ext/boost/chrono/clock_string.hpp
  8. +168 −0 ext/boost/chrono/config.hpp
  9. +31 −0 ext/boost/chrono/detail/is_evenly_divisible_by.hpp
  10. +30 −0 ext/boost/chrono/detail/static_assert.hpp
  11. +29 −0 ext/boost/chrono/detail/system.hpp
  12. +795 −0 ext/boost/chrono/duration.hpp
  13. +233 −0 ext/boost/chrono/system_clocks.hpp
  14. +379 −0 ext/boost/chrono/time_point.hpp
  15. +5 −5 ext/boost/concept_check.hpp
  16. +29 −27 ext/boost/config/compiler/borland.hpp
  17. +40 −26 ext/boost/config/compiler/clang.hpp
  18. +20 −19 ext/boost/config/compiler/codegear.hpp
  19. +27 −25 ext/boost/config/compiler/common_edg.hpp
  20. +24 −22 ext/boost/config/compiler/cray.hpp
  21. +26 −24 ext/boost/config/compiler/digitalmars.hpp
  22. +31 −29 ext/boost/config/compiler/gcc.hpp
  23. +26 −25 ext/boost/config/compiler/gcc_xml.hpp
  24. +26 −24 ext/boost/config/compiler/hp_acc.hpp
  25. +26 −24 ext/boost/config/compiler/intel.hpp
  26. +27 −25 ext/boost/config/compiler/metrowerks.hpp
  27. +27 −25 ext/boost/config/compiler/mpw.hpp
  28. +41 −41 ext/boost/config/compiler/pathscale.hpp
  29. +70 −29 ext/boost/config/compiler/pgi.hpp
  30. +27 −25 ext/boost/config/compiler/sunpro_cc.hpp
  31. +36 −26 ext/boost/config/compiler/vacpp.hpp
  32. +80 −57 ext/boost/config/compiler/visualc.hpp
  33. +0 −71 ext/boost/config/platform/win32.hpp
  34. +25 −22 ext/boost/config/stdlib/dinkumware.hpp
  35. +23 −20 ext/boost/config/stdlib/libcomo.hpp
  36. +5 −4 ext/boost/config/stdlib/libcpp.hpp
  37. +34 −25 ext/boost/config/stdlib/libstdcpp3.hpp
  38. +23 −20 ext/boost/config/stdlib/modena.hpp
  39. +23 −20 ext/boost/config/stdlib/msl.hpp
  40. +23 −20 ext/boost/config/stdlib/roguewave.hpp
  41. +23 −20 ext/boost/config/stdlib/sgi.hpp
  42. +23 −24 ext/boost/config/stdlib/stlport.hpp
  43. +23 −20 ext/boost/config/stdlib/vacpp.hpp
  44. +266 −75 ext/boost/config/suffix.hpp
  45. +14 −18 ext/boost/container/container_fwd.hpp
  46. +1 −2  ext/boost/cstdint.hpp
  47. +1 −1  ext/boost/date_time/adjust_functors.hpp
  48. +1 −1  ext/boost/date_time/c_time.hpp
  49. +1 −1  ext/boost/date_time/compiler_config.hpp
  50. +1 −1  ext/boost/date_time/constrained_value.hpp
  51. +1 −1  ext/boost/date_time/date.hpp
  52. +1 −1  ext/boost/date_time/date_clock_device.hpp
  53. +1 −1  ext/boost/date_time/date_defs.hpp
  54. +1 −1  ext/boost/date_time/date_duration.hpp
  55. +1 −1  ext/boost/date_time/date_duration_types.hpp
  56. +1 −1  ext/boost/date_time/date_facet.hpp
  57. +1 −1  ext/boost/date_time/date_format_simple.hpp
  58. +1 −1  ext/boost/date_time/date_formatting.hpp
  59. +1 −1  ext/boost/date_time/date_formatting_limited.hpp
  60. +1 −1  ext/boost/date_time/date_formatting_locales.hpp
  61. +1 −1  ext/boost/date_time/date_generator_formatter.hpp
  62. +1 −1  ext/boost/date_time/date_generator_parser.hpp
  63. +1 −1  ext/boost/date_time/date_generators.hpp
  64. +1 −1  ext/boost/date_time/date_iterator.hpp
  65. +1 −1  ext/boost/date_time/date_names_put.hpp
  66. +1 −1  ext/boost/date_time/date_parsing.hpp
  67. +1 −1  ext/boost/date_time/dst_rules.hpp
  68. +1 −1  ext/boost/date_time/filetime_functions.hpp
  69. +1 −1  ext/boost/date_time/format_date_parser.hpp
  70. +1 −1  ext/boost/date_time/gregorian/conversion.hpp
  71. +1 −1  ext/boost/date_time/gregorian/formatters.hpp
  72. +1 −1  ext/boost/date_time/gregorian/formatters_limited.hpp
  73. +1 −1  ext/boost/date_time/gregorian/greg_calendar.hpp
  74. +1 −1  ext/boost/date_time/gregorian/greg_date.hpp
  75. +1 −1  ext/boost/date_time/gregorian/greg_day.hpp
  76. +1 −1  ext/boost/date_time/gregorian/greg_day_of_year.hpp
  77. +1 −1  ext/boost/date_time/gregorian/greg_duration.hpp
  78. +1 −1  ext/boost/date_time/gregorian/greg_duration_types.hpp
  79. +1 −1  ext/boost/date_time/gregorian/greg_month.hpp
  80. +1 −1  ext/boost/date_time/gregorian/greg_weekday.hpp
  81. +1 −1  ext/boost/date_time/gregorian/greg_year.hpp
  82. +1 −1  ext/boost/date_time/gregorian/greg_ymd.hpp
  83. +1 −1  ext/boost/date_time/gregorian/gregorian.hpp
  84. +1 −1  ext/boost/date_time/gregorian/gregorian_io.hpp
  85. +1 −1  ext/boost/date_time/gregorian/gregorian_types.hpp
  86. +1 −1  ext/boost/date_time/gregorian/parsers.hpp
  87. +1 −1  ext/boost/date_time/gregorian_calendar.hpp
  88. +1 −1  ext/boost/date_time/gregorian_calendar.ipp
  89. +1 −1  ext/boost/date_time/int_adapter.hpp
  90. +1 −1  ext/boost/date_time/iso_format.hpp
  91. +1 −1  ext/boost/date_time/locale_config.hpp
  92. +1 −1  ext/boost/date_time/microsec_time_clock.hpp
  93. +1 −1  ext/boost/date_time/parse_format_base.hpp
  94. +1 −1  ext/boost/date_time/period.hpp
  95. +1 −1  ext/boost/date_time/period_formatter.hpp
  96. +1 −1  ext/boost/date_time/period_parser.hpp
  97. +1 −1  ext/boost/date_time/posix_time/conversion.hpp
  98. +1 −1  ext/boost/date_time/posix_time/date_duration_operators.hpp
  99. +1 −1  ext/boost/date_time/posix_time/posix_time.hpp
  100. +1 −1  ext/boost/date_time/posix_time/posix_time_config.hpp
  101. +1 −1  ext/boost/date_time/posix_time/posix_time_duration.hpp
  102. +1 −1  ext/boost/date_time/posix_time/posix_time_io.hpp
  103. +1 −1  ext/boost/date_time/posix_time/posix_time_system.hpp
  104. +1 −1  ext/boost/date_time/posix_time/ptime.hpp
  105. +1 −1  ext/boost/date_time/posix_time/time_formatters.hpp
  106. +1 −1  ext/boost/date_time/posix_time/time_parsers.hpp
  107. +1 −1  ext/boost/date_time/posix_time/time_period.hpp
  108. +1 −1  ext/boost/date_time/special_defs.hpp
  109. +1 −1  ext/boost/date_time/special_values_formatter.hpp
  110. +1 −1  ext/boost/date_time/string_convert.hpp
  111. +1 −1  ext/boost/date_time/string_parse_tree.hpp
  112. +1 −1  ext/boost/date_time/strings_from_facet.hpp
  113. +1 −1  ext/boost/date_time/time.hpp
  114. +1 −1  ext/boost/date_time/time_clock.hpp
  115. +1 −1  ext/boost/date_time/time_defs.hpp
  116. +1 −1  ext/boost/date_time/time_duration.hpp
  117. +1 −1  ext/boost/date_time/time_facet.hpp
  118. +1 −1  ext/boost/date_time/time_formatting_streams.hpp
  119. +1 −1  ext/boost/date_time/time_iterator.hpp
  120. +1 −1  ext/boost/date_time/time_parsing.hpp
  121. +1 −1  ext/boost/date_time/time_resolution_traits.hpp
  122. +1 −1  ext/boost/date_time/time_system_counted.hpp
  123. +1 −1  ext/boost/date_time/time_system_split.hpp
  124. +1 −1  ext/boost/date_time/wrapping_int.hpp
  125. +1 −1  ext/boost/date_time/year_month_day.hpp
  126. +162 −0 ext/boost/detail/container_fwd.hpp
  127. +134 −0 ext/boost/detail/is_incrementable.hpp
  128. +337 −0 ext/boost/detail/scoped_enum_emulation.hpp
  129. +1 −1  ext/boost/exception/detail/attribute_noreturn.hpp
  130. +2 −1  ext/boost/exception/detail/error_info_impl.hpp
  131. +7 −2 ext/boost/exception/detail/exception_ptr.hpp
  132. +29 −2 ext/boost/exception/exception.hpp
  133. +1 −1  ext/boost/exception/info.hpp
  134. +1,124 −0 ext/boost/foreach.hpp
  135. +51 −0 ext/boost/foreach_fwd.hpp
  136. +7 −0 ext/boost/functional/hash.hpp
  137. +29 −0 ext/boost/functional/hash/detail/container_fwd_0x.hpp
  138. +246 −0 ext/boost/functional/hash/detail/float_functions.hpp
  139. +115 −0 ext/boost/functional/hash/detail/hash_float.hpp
  140. +91 −0 ext/boost/functional/hash/detail/hash_float_generic.hpp
  141. +61 −0 ext/boost/functional/hash/detail/limits.hpp
  142. +367 −0 ext/boost/functional/hash/extensions.hpp
  143. +496 −0 ext/boost/functional/hash/hash.hpp
  144. +40 −0 ext/boost/functional/hash/hash_fwd.hpp
  145. +7 −0 ext/boost/functional/hash_fwd.hpp
  146. +0 −29 ext/boost/implicit_cast.hpp
  147. +43 −0 ext/boost/indirect_reference.hpp
  148. +19 −15 ext/boost/integer.hpp
  149. +127 −0 ext/boost/integer/static_log2.hpp
  150. +1 −1  ext/boost/integer_traits.hpp
  151. +31 −35 ext/boost/iterator/iterator_facade.hpp
  152. +1 −1  ext/boost/iterator/transform_iterator.hpp
  153. +1,377 −0 ext/boost/lambda/algorithm.hpp
  154. +19 −0 ext/boost/lambda/bind.hpp
  155. +226 −0 ext/boost/lambda/casts.hpp
  156. +274 −0 ext/boost/lambda/closures.hpp
  157. +240 −0 ext/boost/lambda/construct.hpp
  158. +23 −0 ext/boost/lambda/control_structures.hpp
  159. +79 −0 ext/boost/lambda/core.hpp
  160. +174 −0 ext/boost/lambda/detail/actions.hpp
  161. +110 −0 ext/boost/lambda/detail/arity_code.hpp
  162. +1,879 −0 ext/boost/lambda/detail/bind_functions.hpp
  163. +50 −0 ext/boost/lambda/detail/control_constructs_common.hpp
  164. +789 −0 ext/boost/lambda/detail/function_adaptors.hpp
  165. +104 −0 ext/boost/lambda/detail/is_instance_of.hpp
  166. +48 −0 ext/boost/lambda/detail/lambda_config.hpp
  167. +615 −0 ext/boost/lambda/detail/lambda_functor_base.hpp
  168. +324 −0 ext/boost/lambda/detail/lambda_functors.hpp
  169. +74 −0 ext/boost/lambda/detail/lambda_fwd.hpp
  170. +578 −0 ext/boost/lambda/detail/lambda_traits.hpp
  171. +737 −0 ext/boost/lambda/detail/member_ptr.hpp
  172. +139 −0 ext/boost/lambda/detail/operator_actions.hpp
  173. +271 −0 ext/boost/lambda/detail/operator_lambda_func_base.hpp
  174. +917 −0 ext/boost/lambda/detail/operator_return_type_traits.hpp
  175. +370 −0 ext/boost/lambda/detail/operators.hpp
  176. +325 −0 ext/boost/lambda/detail/ret.hpp
  177. +282 −0 ext/boost/lambda/detail/return_type_traits.hpp
  178. +74 −0 ext/boost/lambda/detail/select_functions.hpp
  179. +27 −0 ext/boost/lambda/detail/suppress_unused.hpp
  180. +1,741 −0 ext/boost/lambda/exceptions.hpp
  181. +462 −0 ext/boost/lambda/if.hpp
  182. +34 −0 ext/boost/lambda/lambda.hpp
  183. +505 −0 ext/boost/lambda/loops.hpp
  184. +119 −0 ext/boost/lambda/numeric.hpp
  185. +508 −0 ext/boost/lambda/switch.hpp
  186. +712 −460 ext/boost/lexical_cast.hpp
  187. +430 −0 ext/boost/libs/system/src/error_code.cpp
  188. +40 −0 ext/boost/libs/system/src/local_free_on_destruction.hpp
  189. +61 −0 ext/boost/libs/thread/src/future.cpp
  190. +23 −4 ext/boost/{ → libs/thread}/src/pthread/once.cpp
  191. +131 −42 ext/boost/{ → libs/thread}/src/pthread/thread.cpp
  192. 0  ext/boost/{ → libs/thread}/src/pthread/timeconv.inl
  193. 0  ext/boost/{ → libs/thread}/src/tss_null.cpp
  194. +52 −0 ext/boost/math/special_functions/math_fwd.hpp
  195. +10 −1 ext/boost/math/tools/config.hpp
  196. +70 −19 ext/boost/move/move.hpp
  197. +1 −1  ext/boost/mpl/O1_size.hpp
  198. +1 −1  ext/boost/mpl/O1_size_fwd.hpp
  199. +39 −0 ext/boost/mpl/accumulate.hpp
  200. +1 −1  ext/boost/mpl/advance.hpp
  201. +1 −1  ext/boost/mpl/advance_fwd.hpp
  202. +21 −0 ext/boost/mpl/alias.hpp
  203. +1 −1  ext/boost/mpl/always.hpp
  204. +1 −1  ext/boost/mpl/and.hpp
  205. +1 −1  ext/boost/mpl/apply.hpp
  206. +1 −1  ext/boost/mpl/apply_fwd.hpp
  207. +1 −1  ext/boost/mpl/apply_wrap.hpp
  208. +1 −1  ext/boost/mpl/arg.hpp
  209. +1 −1  ext/boost/mpl/arg_fwd.hpp
  210. +25 −0 ext/boost/mpl/arithmetic.hpp
  211. +38 −0 ext/boost/mpl/as_sequence.hpp
  212. +1 −1  ext/boost/mpl/assert.hpp
  213. +1 −1  ext/boost/mpl/at.hpp
  214. +1 −1  ext/boost/mpl/at_fwd.hpp
  215. +1 −1  ext/boost/mpl/aux_/O1_size_impl.hpp
  216. +1 −1  ext/boost/mpl/aux_/adl_barrier.hpp
  217. +1 −1  ext/boost/mpl/aux_/advance_backward.hpp
  218. +1 −1  ext/boost/mpl/aux_/advance_forward.hpp
  219. +35 −0 ext/boost/mpl/aux_/apply_1st.hpp
  220. +1 −1  ext/boost/mpl/aux_/arg_typedef.hpp
  221. +1 −1  ext/boost/mpl/aux_/arithmetic_op.hpp
  222. +1 −1  ext/boost/mpl/aux_/arity.hpp
  223. +1 −1  ext/boost/mpl/aux_/arity_spec.hpp
  224. +1 −1  ext/boost/mpl/aux_/at_impl.hpp
  225. +43 −0 ext/boost/mpl/aux_/back_impl.hpp
  226. +21 −0 ext/boost/mpl/aux_/basic_bind.hpp
  227. +1 −1  ext/boost/mpl/aux_/begin_end_impl.hpp
  228. +1 −1  ext/boost/mpl/aux_/clear_impl.hpp
  229. +1 −1  ext/boost/mpl/aux_/common_name_wknd.hpp
  230. +1 −1  ext/boost/mpl/aux_/comparison_op.hpp
  231. +1 −1  ext/boost/mpl/aux_/config/adl.hpp
  232. +1 −1  ext/boost/mpl/aux_/config/arrays.hpp
  233. +1 −1  ext/boost/mpl/aux_/config/bind.hpp
  234. +1 −1  ext/boost/mpl/aux_/config/compiler.hpp
  235. +1 −1  ext/boost/mpl/aux_/config/ctps.hpp
  236. +35 −0 ext/boost/mpl/aux_/config/dependent_nttp.hpp
  237. +27 −0 ext/boost/mpl/aux_/config/dmc_ambiguous_ctps.hpp
  238. +1 −1  ext/boost/mpl/aux_/config/dtp.hpp
  239. +1 −1  ext/boost/mpl/aux_/config/eti.hpp
  240. +1 −1  ext/boost/mpl/aux_/config/forwarding.hpp
  241. +1 −1  ext/boost/mpl/aux_/config/gcc.hpp
  242. +1 −1  ext/boost/mpl/aux_/config/has_apply.hpp
  243. +1 −1  ext/boost/mpl/aux_/config/has_xxx.hpp
  244. +1 −1  ext/boost/mpl/aux_/config/integral.hpp
  245. +1 −1  ext/boost/mpl/aux_/config/intel.hpp
  246. +1 −1  ext/boost/mpl/aux_/config/lambda.hpp
  247. +1 −1  ext/boost/mpl/aux_/config/msvc.hpp
  248. +1 −1  ext/boost/mpl/aux_/config/msvc_typename.hpp
  249. +1 −1  ext/boost/mpl/aux_/config/nttp.hpp
  250. +33 −0 ext/boost/mpl/aux_/config/operators.hpp
  251. +1 −1  ext/boost/mpl/aux_/config/overload_resolution.hpp
  252. +1 −1  ext/boost/mpl/aux_/config/pp_counter.hpp
  253. +1 −1  ext/boost/mpl/aux_/config/preprocessor.hpp
  254. +1 −1  ext/boost/mpl/aux_/config/static_constant.hpp
  255. +1 −1  ext/boost/mpl/aux_/config/ttp.hpp
  256. +1 −1  ext/boost/mpl/aux_/config/typeof.hpp
  257. +1 −1  ext/boost/mpl/aux_/config/use_preprocessed.hpp
  258. +1 −1  ext/boost/mpl/aux_/config/workaround.hpp
  259. +1 −1  ext/boost/mpl/aux_/contains_impl.hpp
  260. +105 −0 ext/boost/mpl/aux_/count_args.hpp
  261. +44 −0 ext/boost/mpl/aux_/count_impl.hpp
  262. +43 −0 ext/boost/mpl/aux_/empty_impl.hpp
  263. +69 −0 ext/boost/mpl/aux_/erase_impl.hpp
  264. +32 −0 ext/boost/mpl/aux_/erase_key_impl.hpp
  265. +140 −0 ext/boost/mpl/aux_/filter_iter.hpp
  266. +1 −1  ext/boost/mpl/aux_/fold_impl.hpp
  267. +365 −0 ext/boost/mpl/aux_/fold_impl_body.hpp
  268. +37 −0 ext/boost/mpl/aux_/fold_op.hpp
  269. +37 −0 ext/boost/mpl/aux_/fold_pred.hpp
  270. +41 −0 ext/boost/mpl/aux_/front_impl.hpp
  271. +1 −1  ext/boost/mpl/aux_/full_lambda.hpp
  272. +1 −1  ext/boost/mpl/aux_/has_apply.hpp
  273. +1 −1  ext/boost/mpl/aux_/has_begin.hpp
  274. +34 −0 ext/boost/mpl/aux_/has_key_impl.hpp
  275. +99 −0 ext/boost/mpl/aux_/has_rebind.hpp
  276. +1 −1  ext/boost/mpl/aux_/has_size.hpp
  277. +1 −1  ext/boost/mpl/aux_/has_tag.hpp
  278. +1 −1  ext/boost/mpl/aux_/has_type.hpp
  279. +1 −1  ext/boost/mpl/aux_/include_preprocessed.hpp
  280. +68 −0 ext/boost/mpl/aux_/insert_impl.hpp
  281. +77 −0 ext/boost/mpl/aux_/insert_range_impl.hpp
  282. +1 −1  ext/boost/mpl/aux_/inserter_algorithm.hpp
  283. +1 −1  ext/boost/mpl/aux_/integral_wrapper.hpp
  284. +1 −1  ext/boost/mpl/aux_/is_msvc_eti_arg.hpp
  285. +1 −1  ext/boost/mpl/aux_/iter_apply.hpp
  286. +1 −1  ext/boost/mpl/aux_/iter_fold_if_impl.hpp
  287. +1 −1  ext/boost/mpl/aux_/iter_fold_impl.hpp
  288. +36 −0 ext/boost/mpl/aux_/iter_push_front.hpp
  289. +120 −0 ext/boost/mpl/aux_/joint_iter.hpp
  290. +1 −1  ext/boost/mpl/aux_/lambda_arity_param.hpp
  291. +193 −0 ext/boost/mpl/aux_/lambda_no_ctps.hpp
  292. +1 −1  ext/boost/mpl/aux_/lambda_spec.hpp
  293. +1 −1  ext/boost/mpl/aux_/lambda_support.hpp
  294. +1 −1  ext/boost/mpl/aux_/largest_int.hpp
  295. +165 −0 ext/boost/mpl/aux_/logical_op.hpp
  296. +68 −0 ext/boost/mpl/aux_/msvc_dtw.hpp
  297. +1 −1  ext/boost/mpl/aux_/msvc_eti_base.hpp
  298. +58 −0 ext/boost/mpl/aux_/msvc_is_class.hpp
  299. +1 −1  ext/boost/mpl/aux_/msvc_never_true.hpp
  300. +1 −1  ext/boost/mpl/aux_/msvc_type.hpp
Sorry, we could not display the entire diff because too many files (1,291) changed.
View
4 build/common_library.rb
@@ -34,7 +34,7 @@ def define_libboost_oxt_task(namespace, output_dir, extra_compiler_flags = nil)
flags = "-Iext #{extra_compiler_flags} #{PlatformInfo.portability_cflags} #{EXTRA_CXXFLAGS}"
if boolean_option('RELEASE')
- sources = Dir['ext/boost/src/pthread/*.cpp'] + Dir['ext/oxt/*.cpp']
+ sources = Dir['ext/boost/libs/**/*.cpp'] + Dir['ext/oxt/*.cpp']
sources.sort!
aggregate_source = "#{output_dir}/aggregate.cpp"
@@ -60,7 +60,7 @@ def define_libboost_oxt_task(namespace, output_dir, extra_compiler_flags = nil)
else
# Define compilation targets for .cpp files in ext/boost/src/pthread.
boost_object_files = []
- Dir['ext/boost/src/pthread/*.cpp'].each do |source_file|
+ Dir['ext/boost/libs/**/*.cpp'].each do |source_file|
object_name = File.basename(source_file.sub(/\.cpp$/, '.o'))
boost_output_dir = "#{output_dir}/boost"
object_file = "#{boost_output_dir}/#{object_name}"
View
25 dev/copy_boost_headers.rb
@@ -1,6 +1,6 @@
#!/usr/bin/env ruby
# Phusion Passenger - http://www.modrails.com/
-# Copyright (c) 2010 Phusion
+# Copyright (c) 2010-2012 Phusion
#
# "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
#
@@ -24,17 +24,21 @@
ESSENTIALS = [
"boost/detail/{limits,endian}.hpp",
- "boost/config/*",
+ "boost/config",
+ "boost/mpl",
+ "boost/preprocessor/stringize.hpp",
"boost/smart_ptr/detail/sp_counted_*",
"boost/smart_ptr/detail/atomic_count*",
"boost/smart_ptr/detail/spinlock*",
- "boost/thread/*",
- "boost/thread/*/*",
- "libs/thread/src/*",
+ "boost/thread",
+ "libs/thread/src",
+ "libs/system/src",
"boost/date_time/gregorian/formatters_limited.hpp",
"boost/date_time/date_formatting_limited.hpp",
"boost/non_type.hpp",
"boost/detail/fenv.hpp",
+ "boost/foreach.hpp",
+ "boost/lambda"
]
EXCLUDE = [
"libs/thread/src/win32/*"
@@ -50,6 +54,8 @@
#include <boost/function.hpp>
#include <boost/bind.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
+ #include <boost/foreach.hpp>
+ #include <boost/lambda/lambda.hpp>
}
require 'fileutils'
@@ -84,7 +90,9 @@ def copy_boost_files(patterns, exclude = nil)
copy_boost_files(["#{source}/*"], exclude)
else
target = source.slice(BOOST_DIR.size + 1 .. source.size - 1)
- target.sub!(%r{^libs/thread/}, 'boost/')
+ if target =~ /^libs\//
+ target = "boost/#{target}"
+ end
if !File.exist?(target)
install(source, target)
end
@@ -112,6 +120,9 @@ def cleanup
FileUtils.rm_rf("boost/src/win32")
FileUtils.rm_rf("boost/asio/win32")
FileUtils.rm_rf("boost/smart_ptr/detail/spinlock_w32.hpp")
+ FileUtils.rm_rf("boost/smart_ptr/detail/sp_counted_base_w32.hpp")
+ FileUtils.rm_rf("boost/smart_ptr/detail/atomic_count_win32.hpp")
+ FileUtils.rm_rf("boost/config/platform/win32.hpp")
File.unlink("test.cpp") rescue nil
end
@@ -119,7 +130,7 @@ def cleanup
def copy_dependencies
done = false
while !done
- missing_headers = `g++ test.cpp -c -I. 2>&1`.
+ missing_headers = `g++ -DBOOST_MPL_PREPROCESSING_MODE test.cpp -c -I. 2>&1`.
split("\n").
grep(/error: .*: No such file/).
map do |line|
View
181 ext/boost/aligned_storage.hpp
@@ -0,0 +1,181 @@
+//-----------------------------------------------------------------------------
+// boost aligned_storage.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2002-2003
+// Eric Friedman, Itay Maman
+//
+// 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)
+
+#ifndef BOOST_ALIGNED_STORAGE_HPP
+#define BOOST_ALIGNED_STORAGE_HPP
+
+#include <cstddef> // for std::size_t
+
+#include "boost/config.hpp"
+#include "boost/detail/workaround.hpp"
+#include "boost/type_traits/alignment_of.hpp"
+#include "boost/type_traits/type_with_alignment.hpp"
+#include "boost/type_traits/is_pod.hpp"
+
+#include "boost/mpl/eval_if.hpp"
+#include "boost/mpl/identity.hpp"
+
+#include "boost/type_traits/detail/bool_trait_def.hpp"
+
+namespace boost {
+
+namespace detail { namespace aligned_storage {
+
+BOOST_STATIC_CONSTANT(
+ std::size_t
+ , alignment_of_max_align = ::boost::alignment_of<max_align>::value
+ );
+
+//
+// To be TR1 conforming this must be a POD type:
+//
+template <
+ std::size_t size_
+ , std::size_t alignment_
+>
+struct aligned_storage_imp
+{
+ union data_t
+ {
+ char buf[size_];
+
+ typename mpl::eval_if_c<
+ alignment_ == std::size_t(-1)
+ , mpl::identity<detail::max_align>
+ , type_with_alignment<alignment_>
+ >::type align_;
+ } data_;
+ void* address() const { return const_cast<aligned_storage_imp*>(this); }
+};
+
+template< std::size_t alignment_ >
+struct aligned_storage_imp<0u,alignment_>
+{
+ /* intentionally empty */
+ void* address() const { return 0; }
+};
+
+}} // namespace detail::aligned_storage
+
+template <
+ std::size_t size_
+ , std::size_t alignment_ = std::size_t(-1)
+>
+class aligned_storage :
+#ifndef __BORLANDC__
+ private
+#else
+ public
+#endif
+ detail::aligned_storage::aligned_storage_imp<size_, alignment_>
+{
+
+public: // constants
+
+ typedef detail::aligned_storage::aligned_storage_imp<size_, alignment_> type;
+
+ BOOST_STATIC_CONSTANT(
+ std::size_t
+ , size = size_
+ );
+ BOOST_STATIC_CONSTANT(
+ std::size_t
+ , alignment = (
+ alignment_ == std::size_t(-1)
+ ? ::boost::detail::aligned_storage::alignment_of_max_align
+ : alignment_
+ )
+ );
+
+#if defined(__GNUC__) &&\
+ (__GNUC__ > 3) ||\
+ (__GNUC__ == 3 && (__GNUC_MINOR__ > 2 ||\
+ (__GNUC_MINOR__ == 2 && __GNUC_PATCHLEVEL__ >=3)))
+
+private: // noncopyable
+
+ aligned_storage(const aligned_storage&);
+ aligned_storage& operator=(const aligned_storage&);
+
+#else // gcc less than 3.2.3
+
+public: // _should_ be noncopyable, but GCC compiler emits error
+
+ aligned_storage(const aligned_storage&);
+ aligned_storage& operator=(const aligned_storage&);
+
+#endif // gcc < 3.2.3 workaround
+
+public: // structors
+
+ aligned_storage()
+ {
+ }
+
+ ~aligned_storage()
+ {
+ }
+
+public: // accessors
+
+ void* address()
+ {
+ return static_cast<type*>(this)->address();
+ }
+
+#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
+
+ const void* address() const
+ {
+ return static_cast<const type*>(this)->address();
+ }
+
+#else // MSVC6
+
+ const void* address() const;
+
+#endif // MSVC6 workaround
+
+};
+
+#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
+
+// MSVC6 seems not to like inline functions with const void* returns, so we
+// declare the following here:
+
+template <std::size_t S, std::size_t A>
+const void* aligned_storage<S,A>::address() const
+{
+ return const_cast< aligned_storage<S,A>* >(this)->address();
+}
+
+#endif // MSVC6 workaround
+
+#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+//
+// Make sure that is_pod recognises aligned_storage<>::type
+// as a POD (Note that aligned_storage<> itself is not a POD):
+//
+template <std::size_t size_, std::size_t alignment_>
+struct is_pod<boost::detail::aligned_storage::aligned_storage_imp<size_,alignment_> >
+ BOOST_TT_AUX_BOOL_C_BASE(true)
+{
+ BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(true)
+};
+#endif
+
+
+} // namespace boost
+
+#include "boost/type_traits/detail/bool_trait_undef.hpp"
+
+#endif // BOOST_ALIGNED_STORAGE_HPP
View
446 ext/boost/array.hpp
@@ -0,0 +1,446 @@
+/* The following code declares class array,
+ * an STL container (as wrapper) for arrays of constant size.
+ *
+ * See
+ * http://www.boost.org/libs/array/
+ * for documentation.
+ *
+ * The original author site is at: http://www.josuttis.com/
+ *
+ * (C) Copyright Nicolai M. Josuttis 2001.
+ *
+ * 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)
+ *
+ * 14 Apr 2012 - (mtc) Added support for boost::hash
+ * 28 Dec 2010 - (mtc) Added cbegin and cend (and crbegin and crend) for C++Ox compatibility.
+ * 10 Mar 2010 - (mtc) fill method added, matching resolution of the standard library working group.
+ * See <http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#776> or Trac issue #3168
+ * Eventually, we should remove "assign" which is now a synonym for "fill" (Marshall Clow)
+ * 10 Mar 2010 - added workaround for SUNCC and !STLPort [trac #3893] (Marshall Clow)
+ * 29 Jan 2004 - c_array() added, BOOST_NO_PRIVATE_IN_AGGREGATE removed (Nico Josuttis)
+ * 23 Aug 2002 - fix for Non-MSVC compilers combined with MSVC libraries.
+ * 05 Aug 2001 - minor update (Nico Josuttis)
+ * 20 Jan 2001 - STLport fix (Beman Dawes)
+ * 29 Sep 2000 - Initial Revision (Nico Josuttis)
+ *
+ * Jan 29, 2004
+ */
+#ifndef BOOST_ARRAY_HPP
+#define BOOST_ARRAY_HPP
+
+#include <boost/detail/workaround.hpp>
+
+#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
+# pragma warning(push)
+# pragma warning(disable:4996) // 'std::equal': Function call with parameters that may be unsafe
+# pragma warning(disable:4510) // boost::array<T,N>' : default constructor could not be generated
+# pragma warning(disable:4610) // warning C4610: class 'boost::array<T,N>' can never be instantiated - user defined constructor required
+#endif
+
+#include <cstddef>
+#include <stdexcept>
+#include <boost/assert.hpp>
+#include <boost/swap.hpp>
+
+// Handles broken standard libraries better than <iterator>
+#include <boost/detail/iterator.hpp>
+#include <boost/throw_exception.hpp>
+#include <boost/functional/hash_fwd.hpp>
+#include <algorithm>
+
+// FIXES for broken compilers
+#include <boost/config.hpp>
+
+
+namespace boost {
+
+ template<class T, std::size_t N>
+ class array {
+ public:
+ T elems[N]; // fixed-size array of elements of type T
+
+ public:
+ // type definitions
+ typedef T value_type;
+ typedef T* iterator;
+ typedef const T* const_iterator;
+ typedef T& reference;
+ typedef const T& const_reference;
+ typedef std::size_t size_type;
+ typedef std::ptrdiff_t difference_type;
+
+ // iterator support
+ iterator begin() { return elems; }
+ const_iterator begin() const { return elems; }
+ const_iterator cbegin() const { return elems; }
+
+ iterator end() { return elems+N; }
+ const_iterator end() const { return elems+N; }
+ const_iterator cend() const { return elems+N; }
+
+ // reverse iterator support
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_MSVC_STD_ITERATOR) && !defined(BOOST_NO_STD_ITERATOR_TRAITS)
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+#elif defined(_MSC_VER) && (_MSC_VER == 1300) && defined(BOOST_DINKUMWARE_STDLIB) && (BOOST_DINKUMWARE_STDLIB == 310)
+ // workaround for broken reverse_iterator in VC7
+ typedef std::reverse_iterator<std::_Ptrit<value_type, difference_type, iterator,
+ reference, iterator, reference> > reverse_iterator;
+ typedef std::reverse_iterator<std::_Ptrit<value_type, difference_type, const_iterator,
+ const_reference, iterator, reference> > const_reverse_iterator;
+#elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC)
+ typedef std::reverse_iterator<iterator, std::random_access_iterator_tag,
+ value_type, reference, iterator, difference_type> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator, std::random_access_iterator_tag,
+ value_type, const_reference, const_iterator, difference_type> const_reverse_iterator;
+#else
+ // workaround for broken reverse_iterator implementations
+ typedef std::reverse_iterator<iterator,T> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator,T> const_reverse_iterator;
+#endif
+
+ reverse_iterator rbegin() { return reverse_iterator(end()); }
+ const_reverse_iterator rbegin() const {
+ return const_reverse_iterator(end());
+ }
+ const_reverse_iterator crbegin() const {
+ return const_reverse_iterator(end());
+ }
+
+ reverse_iterator rend() { return reverse_iterator(begin()); }
+ const_reverse_iterator rend() const {
+ return const_reverse_iterator(begin());
+ }
+ const_reverse_iterator crend() const {
+ return const_reverse_iterator(begin());
+ }
+
+ // operator[]
+ reference operator[](size_type i)
+ {
+ BOOST_ASSERT_MSG( i < N, "out of range" );
+ return elems[i];
+ }
+
+ const_reference operator[](size_type i) const
+ {
+ BOOST_ASSERT_MSG( i < N, "out of range" );
+ return elems[i];
+ }
+
+ // at() with range check
+ reference at(size_type i) { rangecheck(i); return elems[i]; }
+ const_reference at(size_type i) const { rangecheck(i); return elems[i]; }
+
+ // front() and back()
+ reference front()
+ {
+ return elems[0];
+ }
+
+ const_reference front() const
+ {
+ return elems[0];
+ }
+
+ reference back()
+ {
+ return elems[N-1];
+ }
+
+ const_reference back() const
+ {
+ return elems[N-1];
+ }
+
+ // size is constant
+ static size_type size() { return N; }
+ static bool empty() { return false; }
+ static size_type max_size() { return N; }
+ enum { static_size = N };
+
+ // swap (note: linear complexity)
+ void swap (array<T,N>& y) {
+ for (size_type i = 0; i < N; ++i)
+ boost::swap(elems[i],y.elems[i]);
+ }
+
+ // direct access to data (read-only)
+ const T* data() const { return elems; }
+ T* data() { return elems; }
+
+ // use array as C array (direct read/write access to data)
+ T* c_array() { return elems; }
+
+ // assignment with type conversion
+ template <typename T2>
+ array<T,N>& operator= (const array<T2,N>& rhs) {
+ std::copy(rhs.begin(),rhs.end(), begin());
+ return *this;
+ }
+
+ // assign one value to all elements
+ void assign (const T& value) { fill ( value ); } // A synonym for fill
+ void fill (const T& value)
+ {
+ std::fill_n(begin(),size(),value);
+ }
+
+ // check range (may be private because it is static)
+ static void rangecheck (size_type i) {
+ if (i >= size()) {
+ std::out_of_range e("array<>: index out of range");
+ boost::throw_exception(e);
+ }
+ }
+
+ };
+
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+ template< class T >
+ class array< T, 0 > {
+
+ public:
+ // type definitions
+ typedef T value_type;
+ typedef T* iterator;
+ typedef const T* const_iterator;
+ typedef T& reference;
+ typedef const T& const_reference;
+ typedef std::size_t size_type;
+ typedef std::ptrdiff_t difference_type;
+
+ // iterator support
+ iterator begin() { return iterator( reinterpret_cast< T * >( this ) ); }
+ const_iterator begin() const { return const_iterator( reinterpret_cast< const T * >( this ) ); }
+ const_iterator cbegin() const { return const_iterator( reinterpret_cast< const T * >( this ) ); }
+
+ iterator end() { return begin(); }
+ const_iterator end() const { return begin(); }
+ const_iterator cend() const { return cbegin(); }
+
+ // reverse iterator support
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_MSVC_STD_ITERATOR) && !defined(BOOST_NO_STD_ITERATOR_TRAITS)
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+#elif defined(_MSC_VER) && (_MSC_VER == 1300) && defined(BOOST_DINKUMWARE_STDLIB) && (BOOST_DINKUMWARE_STDLIB == 310)
+ // workaround for broken reverse_iterator in VC7
+ typedef std::reverse_iterator<std::_Ptrit<value_type, difference_type, iterator,
+ reference, iterator, reference> > reverse_iterator;
+ typedef std::reverse_iterator<std::_Ptrit<value_type, difference_type, const_iterator,
+ const_reference, iterator, reference> > const_reverse_iterator;
+#elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC)
+ typedef std::reverse_iterator<iterator, std::random_access_iterator_tag,
+ value_type, reference, iterator, difference_type> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator, std::random_access_iterator_tag,
+ value_type, const_reference, const_iterator, difference_type> const_reverse_iterator;
+#else
+ // workaround for broken reverse_iterator implementations
+ typedef std::reverse_iterator<iterator,T> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator,T> const_reverse_iterator;
+#endif
+
+ reverse_iterator rbegin() { return reverse_iterator(end()); }
+ const_reverse_iterator rbegin() const {
+ return const_reverse_iterator(end());
+ }
+ const_reverse_iterator crbegin() const {
+ return const_reverse_iterator(end());
+ }
+
+ reverse_iterator rend() { return reverse_iterator(begin()); }
+ const_reverse_iterator rend() const {
+ return const_reverse_iterator(begin());
+ }
+ const_reverse_iterator crend() const {
+ return const_reverse_iterator(begin());
+ }
+
+ // operator[]
+ reference operator[](size_type /*i*/)
+ {
+ return failed_rangecheck();
+ }
+
+ const_reference operator[](size_type /*i*/) const
+ {
+ return failed_rangecheck();
+ }
+
+ // at() with range check
+ reference at(size_type /*i*/) { return failed_rangecheck(); }
+ const_reference at(size_type /*i*/) const { return failed_rangecheck(); }
+
+ // front() and back()
+ reference front()
+ {
+ return failed_rangecheck();
+ }
+
+ const_reference front() const
+ {
+ return failed_rangecheck();
+ }
+
+ reference back()
+ {
+ return failed_rangecheck();
+ }
+
+ const_reference back() const
+ {
+ return failed_rangecheck();
+ }
+
+ // size is constant
+ static size_type size() { return 0; }
+ static bool empty() { return true; }
+ static size_type max_size() { return 0; }
+ enum { static_size = 0 };
+
+ void swap (array<T,0>& /*y*/) {
+ }
+
+ // direct access to data (read-only)
+ const T* data() const { return 0; }
+ T* data() { return 0; }
+
+ // use array as C array (direct read/write access to data)
+ T* c_array() { return 0; }
+
+ // assignment with type conversion
+ template <typename T2>
+ array<T,0>& operator= (const array<T2,0>& ) {
+ return *this;
+ }
+
+ // assign one value to all elements
+ void assign (const T& value) { fill ( value ); }
+ void fill (const T& ) {}
+
+ // check range (may be private because it is static)
+ static reference failed_rangecheck () {
+ std::out_of_range e("attempt to access element of an empty array");
+ boost::throw_exception(e);
+#if defined(BOOST_NO_EXCEPTIONS) || (!defined(BOOST_MSVC) && !defined(__PATHSCALE__))
+ //
+ // We need to return something here to keep
+ // some compilers happy: however we will never
+ // actually get here....
+ //
+ static T placeholder;
+ return placeholder;
+#endif
+ }
+ };
+#endif
+
+ // comparisons
+ template<class T, std::size_t N>
+ bool operator== (const array<T,N>& x, const array<T,N>& y) {
+ return std::equal(x.begin(), x.end(), y.begin());
+ }
+ template<class T, std::size_t N>
+ bool operator< (const array<T,N>& x, const array<T,N>& y) {
+ return std::lexicographical_compare(x.begin(),x.end(),y.begin(),y.end());
+ }
+ template<class T, std::size_t N>
+ bool operator!= (const array<T,N>& x, const array<T,N>& y) {
+ return !(x==y);
+ }
+ template<class T, std::size_t N>
+ bool operator> (const array<T,N>& x, const array<T,N>& y) {
+ return y<x;
+ }
+ template<class T, std::size_t N>
+ bool operator<= (const array<T,N>& x, const array<T,N>& y) {
+ return !(y<x);
+ }
+ template<class T, std::size_t N>
+ bool operator>= (const array<T,N>& x, const array<T,N>& y) {
+ return !(x<y);
+ }
+
+ // global swap()
+ template<class T, std::size_t N>
+ inline void swap (array<T,N>& x, array<T,N>& y) {
+ x.swap(y);
+ }
+
+#if defined(__SUNPRO_CC)
+// Trac ticket #4757; the Sun Solaris compiler can't handle
+// syntax like 'T(&get_c_array(boost::array<T,N>& arg))[N]'
+//
+// We can't just use this for all compilers, because the
+// borland compilers can't handle this form.
+ namespace detail {
+ template <typename T, std::size_t N> struct c_array
+ {
+ typedef T type[N];
+ };
+ }
+
+ // Specific for boost::array: simply returns its elems data member.
+ template <typename T, std::size_t N>
+ typename detail::c_array<T,N>::type& get_c_array(boost::array<T,N>& arg)
+ {
+ return arg.elems;
+ }
+
+ // Specific for boost::array: simply returns its elems data member.
+ template <typename T, std::size_t N>
+ typename const detail::c_array<T,N>::type& get_c_array(const boost::array<T,N>& arg)
+ {
+ return arg.elems;
+ }
+#else
+// Specific for boost::array: simply returns its elems data member.
+ template <typename T, std::size_t N>
+ T(&get_c_array(boost::array<T,N>& arg))[N]
+ {
+ return arg.elems;
+ }
+
+ // Const version.
+ template <typename T, std::size_t N>
+ const T(&get_c_array(const boost::array<T,N>& arg))[N]
+ {
+ return arg.elems;
+ }
+#endif
+
+#if 0
+ // Overload for std::array, assuming that std::array will have
+ // explicit conversion functions as discussed at the WG21 meeting
+ // in Summit, March 2009.
+ template <typename T, std::size_t N>
+ T(&get_c_array(std::array<T,N>& arg))[N]
+ {
+ return static_cast<T(&)[N]>(arg);
+ }
+
+ // Const version.
+ template <typename T, std::size_t N>
+ const T(&get_c_array(const std::array<T,N>& arg))[N]
+ {
+ return static_cast<T(&)[N]>(arg);
+ }
+#endif
+
+
+ template<class T, std::size_t N>
+ std::size_t hash_value(const array<T,N>& arr)
+ {
+ return boost::hash_range(arr.begin(), arr.end());
+ }
+
+} /* namespace boost */
+
+
+#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
+# pragma warning(pop)
+#endif
+
+#endif /*BOOST_ARRAY_HPP*/
View
331 ext/boost/cerrno.hpp
@@ -0,0 +1,331 @@
+// Boost cerrno.hpp header -------------------------------------------------//
+
+// Copyright Beman Dawes 2005.
+// Use, modification, and distribution is 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 library home page at http://www.boost.org/libs/system
+
+#ifndef BOOST_CERRNO_HPP
+#define BOOST_CERRNO_HPP
+
+#include <cerrno>
+
+// supply errno values likely to be missing, particularly on Windows
+
+#ifndef EAFNOSUPPORT
+#define EAFNOSUPPORT 9901
+#endif
+
+#ifndef EADDRINUSE
+#define EADDRINUSE 9902
+#endif
+
+#ifndef EADDRNOTAVAIL
+#define EADDRNOTAVAIL 9903
+#endif
+
+#ifndef EISCONN
+#define EISCONN 9904
+#endif
+
+#ifndef EBADMSG
+#define EBADMSG 9905
+#endif
+
+#ifndef ECONNABORTED
+#define ECONNABORTED 9906
+#endif
+
+#ifndef EALREADY
+#define EALREADY 9907
+#endif
+
+#ifndef ECONNREFUSED
+#define ECONNREFUSED 9908
+#endif
+
+#ifndef ECONNRESET
+#define ECONNRESET 9909
+#endif
+
+#ifndef EDESTADDRREQ
+#define EDESTADDRREQ 9910
+#endif
+
+#ifndef EHOSTUNREACH
+#define EHOSTUNREACH 9911
+#endif
+
+#ifndef EIDRM
+#define EIDRM 9912
+#endif
+
+#ifndef EMSGSIZE
+#define EMSGSIZE 9913
+#endif
+
+#ifndef ENETDOWN
+#define ENETDOWN 9914
+#endif
+
+#ifndef ENETRESET
+#define ENETRESET 9915
+#endif
+
+#ifndef ENETUNREACH
+#define ENETUNREACH 9916
+#endif
+
+#ifndef ENOBUFS
+#define ENOBUFS 9917
+#endif
+
+#ifndef ENOLINK
+#define ENOLINK 9918
+#endif
+
+#ifndef ENODATA
+#define ENODATA 9919
+#endif
+
+#ifndef ENOMSG
+#define ENOMSG 9920
+#endif
+
+#ifndef ENOPROTOOPT
+#define ENOPROTOOPT 9921
+#endif
+
+#ifndef ENOSR
+#define ENOSR 9922
+#endif
+
+#ifndef ENOTSOCK
+#define ENOTSOCK 9923
+#endif
+
+#ifndef ENOSTR
+#define ENOSTR 9924
+#endif
+
+#ifndef ENOTCONN
+#define ENOTCONN 9925
+#endif
+
+#ifndef ENOTSUP
+#define ENOTSUP 9926
+#endif
+
+#ifndef ECANCELED
+#define ECANCELED 9927
+#endif
+
+#ifndef EINPROGRESS
+#define EINPROGRESS 9928
+#endif
+
+#ifndef EOPNOTSUPP
+#define EOPNOTSUPP 9929
+#endif
+
+#ifndef EWOULDBLOCK
+#define EWOULDBLOCK 9930
+#endif
+
+#ifndef EOWNERDEAD
+#define EOWNERDEAD 9931
+#endif
+
+#ifndef EPROTO
+#define EPROTO 9932
+#endif
+
+#ifndef EPROTONOSUPPORT
+#define EPROTONOSUPPORT 9933
+#endif
+
+#ifndef ENOTRECOVERABLE
+#define ENOTRECOVERABLE 9934
+#endif
+
+#ifndef ETIME
+#define ETIME 9935
+#endif
+
+#ifndef ETXTBSY
+#define ETXTBSY 9936
+#endif
+
+#ifndef ETIMEDOUT
+#define ETIMEDOUT 9938
+#endif
+
+#ifndef ELOOP
+#define ELOOP 9939
+#endif
+
+#ifndef EOVERFLOW
+#define EOVERFLOW 9940
+#endif
+
+#ifndef EPROTOTYPE
+#define EPROTOTYPE 9941
+#endif
+
+#ifndef ENOSYS
+#define ENOSYS 9942
+#endif
+
+#ifndef EINVAL
+#define EINVAL 9943
+#endif
+
+#ifndef ERANGE
+#define ERANGE 9944
+#endif
+
+#ifndef EILSEQ
+#define EILSEQ 9945
+#endif
+
+// Windows Mobile doesn't appear to define these:
+
+#ifndef E2BIG
+#define E2BIG 9946
+#endif
+
+#ifndef EDOM
+#define EDOM 9947
+#endif
+
+#ifndef EFAULT
+#define EFAULT 9948
+#endif
+
+#ifndef EBADF
+#define EBADF 9949
+#endif
+
+#ifndef EPIPE
+#define EPIPE 9950
+#endif
+
+#ifndef EXDEV
+#define EXDEV 9951
+#endif
+
+#ifndef EBUSY
+#define EBUSY 9952
+#endif
+
+#ifndef ENOTEMPTY
+#define ENOTEMPTY 9953
+#endif
+
+#ifndef ENOEXEC
+#define ENOEXEC 9954
+#endif
+
+#ifndef EEXIST
+#define EEXIST 9955
+#endif
+
+#ifndef EFBIG
+#define EFBIG 9956
+#endif
+
+#ifndef ENAMETOOLONG
+#define ENAMETOOLONG 9957
+#endif
+
+#ifndef ENOTTY
+#define ENOTTY 9958
+#endif
+
+#ifndef EINTR
+#define EINTR 9959
+#endif
+
+#ifndef ESPIPE
+#define ESPIPE 9960
+#endif
+
+#ifndef EIO
+#define EIO 9961
+#endif
+
+#ifndef EISDIR
+#define EISDIR 9962
+#endif
+
+#ifndef ECHILD
+#define ECHILD 9963
+#endif
+
+#ifndef ENOLCK
+#define ENOLCK 9964
+#endif
+
+#ifndef ENOSPC
+#define ENOSPC 9965
+#endif
+
+#ifndef ENXIO
+#define ENXIO 9966
+#endif
+
+#ifndef ENODEV
+#define ENODEV 9967
+#endif
+
+#ifndef ENOENT
+#define ENOENT 9968
+#endif
+
+#ifndef ESRCH
+#define ESRCH 9969
+#endif
+
+#ifndef ENOTDIR
+#define ENOTDIR 9970
+#endif
+
+#ifndef ENOMEM
+#define ENOMEM 9971
+#endif
+
+#ifndef EPERM
+#define EPERM 9972
+#endif
+
+#ifndef EACCES
+#define EACCES 9973
+#endif
+
+#ifndef EROFS
+#define EROFS 9974
+#endif
+
+#ifndef EDEADLK
+#define EDEADLK 9975
+#endif
+
+#ifndef EAGAIN
+#define EAGAIN 9976
+#endif
+
+#ifndef ENFILE
+#define ENFILE 9977
+#endif
+
+#ifndef EMFILE
+#define EMFILE 9978
+#endif
+
+#ifndef EMLINK
+#define EMLINK 9979
+#endif
+
+#endif // include guard
View
36 ext/boost/chrono/ceil.hpp
@@ -0,0 +1,36 @@
+// boost/chrono/round.hpp ------------------------------------------------------------//
+
+// (C) Copyright Howard Hinnant
+// Copyright 2011 Vicente J. Botet Escriba
+
+// 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)
+
+// See http://www.boost.org/libs/chrono for documentation.
+
+#ifndef BOOST_CHRONO_CEIL_HPP
+#define BOOST_CHRONO_CEIL_HPP
+
+#include <boost/chrono/duration.hpp>
+
+namespace boost
+{
+ namespace chrono
+ {
+
+ /**
+ * rounds up
+ */
+ template <class To, class Rep, class Period>
+ To ceil(const duration<Rep, Period>& d)
+ {
+ To t = duration_cast<To>(d);
+ if (t < d)
+ ++t;
+ return t;
+ }
+
+ } // namespace chrono
+} // namespace boost
+
+#endif
View
25 ext/boost/chrono/clock_string.hpp
@@ -0,0 +1,25 @@
+//
+// (C) Copyright 2010-2011 Vicente J. Botet Escriba
+// 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).
+//
+
+#ifndef BOOST_CHRONO_CLOCK_STRING_HPP
+#define BOOST_CHRONO_CLOCK_STRING_HPP
+
+#include <string>
+
+namespace boost
+{
+ namespace chrono
+ {
+
+ template<class Clock, class CharT>
+ struct clock_string;
+
+ } // chrono
+
+} // boost
+
+#endif // BOOST_CHRONO_CLOCK_STRING_HPP
View
168 ext/boost/chrono/config.hpp
@@ -0,0 +1,168 @@
+// boost/chrono/config.hpp -------------------------------------------------//
+
+// Copyright Beman Dawes 2003, 2006, 2008
+// Copyright 2009-2011 Vicente J. Botet Escriba
+
+// 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)
+
+// See http://www.boost.org/libs/chrono for documentation.
+
+#ifndef BOOST_CHRONO_CONFIG_HPP
+#define BOOST_CHRONO_CONFIG_HPP
+
+#include <boost/config.hpp>
+
+#if !defined BOOST_CHRONO_VERSION
+#define BOOST_CHRONO_VERSION 1
+#else
+#if BOOST_CHRONO_VERSION!=1 && BOOST_CHRONO_VERSION!=2
+#error "BOOST_CHRONO_VERSION must be 1 or 2"
+#endif
+#endif
+
+#if defined(BOOST_CHRONO_SOURCE) && !defined(BOOST_USE_WINDOWS_H)
+#define BOOST_USE_WINDOWS_H
+#endif
+
+// BOOST_CHRONO_POSIX_API, BOOST_CHRONO_MAC_API, or BOOST_CHRONO_WINDOWS_API
+// can be defined by the user to specify which API should be used
+
+#if defined(BOOST_CHRONO_WINDOWS_API)
+# warning Boost.Chrono will use the Windows API
+#elif defined(BOOST_CHRONO_MAC_API)
+# warning Boost.Chrono will use the Mac API
+#elif defined(BOOST_CHRONO_POSIX_API)
+# warning Boost.Chrono will use the POSIX API
+#endif
+
+# if defined( BOOST_CHRONO_WINDOWS_API ) && defined( BOOST_CHRONO_POSIX_API )
+# error both BOOST_CHRONO_WINDOWS_API and BOOST_CHRONO_POSIX_API are defined
+# elif defined( BOOST_CHRONO_WINDOWS_API ) && defined( BOOST_CHRONO_MAC_API )
+# error both BOOST_CHRONO_WINDOWS_API and BOOST_CHRONO_MAC_API are defined
+# elif defined( BOOST_CHRONO_MAC_API ) && defined( BOOST_CHRONO_POSIX_API )
+# error both BOOST_CHRONO_MAC_API and BOOST_CHRONO_POSIX_API are defined
+# elif !defined( BOOST_CHRONO_WINDOWS_API ) && !defined( BOOST_CHRONO_MAC_API ) && !defined( BOOST_CHRONO_POSIX_API )
+# if (defined(_WIN32) || defined(__WIN32__) || defined(WIN32))
+# define BOOST_CHRONO_WINDOWS_API
+# elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)
+# define BOOST_CHRONO_MAC_API
+# else
+# define BOOST_CHRONO_POSIX_API
+# endif
+# endif
+
+# if defined( BOOST_CHRONO_WINDOWS_API )
+# ifndef UNDER_CE
+# define BOOST_CHRONO_HAS_PROCESS_CLOCKS
+# endif
+# define BOOST_CHRONO_HAS_CLOCK_STEADY
+# define BOOST_CHRONO_HAS_THREAD_CLOCK
+# define BOOST_CHRONO_THREAD_CLOCK_IS_STEADY true
+# endif
+
+# if defined( BOOST_CHRONO_MAC_API )
+# define BOOST_CHRONO_HAS_PROCESS_CLOCKS
+# define BOOST_CHRONO_HAS_CLOCK_STEADY
+# define BOOST_CHRONO_THREAD_CLOCK_IS_STEADY true
+# endif
+
+# if defined( BOOST_CHRONO_POSIX_API )
+# define BOOST_CHRONO_HAS_PROCESS_CLOCKS
+# include <time.h> //to check for CLOCK_REALTIME and CLOCK_MONOTONIC and _POSIX_THREAD_CPUTIME
+# if defined(CLOCK_MONOTONIC)
+# define BOOST_CHRONO_HAS_CLOCK_STEADY
+# endif
+# if defined(_POSIX_THREAD_CPUTIME) && !defined(BOOST_DISABLE_THREADS)
+# define BOOST_CHRONO_HAS_THREAD_CLOCK
+# define BOOST_CHRONO_THREAD_CLOCK_IS_STEADY true
+# endif
+# if defined(CLOCK_THREAD_CPUTIME_ID) && !defined(BOOST_DISABLE_THREADS)
+# define BOOST_CHRONO_HAS_THREAD_CLOCK
+# define BOOST_CHRONO_THREAD_CLOCK_IS_STEADY true
+# endif
+# if defined(sun) || defined(__sun)
+# undef BOOST_CHRONO_HAS_THREAD_CLOCK
+# undef BOOST_CHRONO_THREAD_CLOCK_IS_STEADY
+# endif
+# if defined(__HP_aCC) && defined(__hpux)
+# undef BOOST_CHRONO_HAS_THREAD_CLOCK
+# undef BOOST_CHRONO_THREAD_CLOCK_IS_STEADY
+# endif
+# endif
+
+#if defined(BOOST_CHRONO_THREAD_DISABLED) && defined(BOOST_CHRONO_HAS_THREAD_CLOCK)
+#undef BOOST_CHRONO_HAS_THREAD_CLOCK
+#undef BOOST_CHRONO_THREAD_CLOCK_IS_STEADY
+#endif
+
+//#undef BOOST_CHRONO_HAS_PROCESS_CLOCKS
+
+// unicode support ------------------------------//
+
+#if defined(BOOST_NO_UNICODE_LITERALS) || defined(BOOST_NO_CHAR16_T) || defined(BOOST_NO_CHAR32_T)
+//~ #define BOOST_CHRONO_HAS_UNICODE_SUPPORT
+#else
+#define BOOST_CHRONO_HAS_UNICODE_SUPPORT 1
+#endif
+
+#if ! defined BOOST_NOEXCEPT
+#if defined(BOOST_NO_NOEXCEPT)
+#define BOOST_NOEXCEPT
+#else
+#define BOOST_NOEXCEPT noexcept
+#endif
+#endif
+
+#ifdef BOOST_CHRONO_HEADER_ONLY
+#define BOOST_CHRONO_INLINE inline
+#define BOOST_CHRONO_STATIC inline
+#define BOOST_CHRONO_DECL
+
+#else
+#define BOOST_CHRONO_INLINE
+#define BOOST_CHRONO_STATIC static
+
+// enable dynamic linking on Windows ---------------------------------------//
+
+// we need to import/export our code only if the user has specifically
+// asked for it by defining either BOOST_ALL_DYN_LINK if they want all boost
+// libraries to be dynamically linked, or BOOST_CHRONO_DYN_LINK
+// if they want just this one to be dynamically liked:
+#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_CHRONO_DYN_LINK)
+// export if this is our own source, otherwise import:
+#ifdef BOOST_CHRONO_SOURCE
+# define BOOST_CHRONO_DECL BOOST_SYMBOL_EXPORT
+#else
+# define BOOST_CHRONO_DECL BOOST_SYMBOL_IMPORT
+#endif // BOOST_CHRONO_SOURCE
+#endif // DYN_LINK
+//
+// if BOOST_CHRONO_DECL isn't defined yet define it now:
+#ifndef BOOST_CHRONO_DECL
+#define BOOST_CHRONO_DECL
+#endif
+
+//#define BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
+
+// enable automatic library variant selection ------------------------------//
+
+#if !defined(BOOST_CHRONO_SOURCE) && !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_CHRONO_NO_LIB)
+//
+// Set the name of our library; this will get undef'ed by auto_link.hpp
+// once it's done with it:
+//
+#define BOOST_LIB_NAME boost_chrono
+//
+// If we're importing code from a dll, then tell auto_link.hpp about it:
+//
+#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_CHRONO_DYN_LINK)
+# define BOOST_DYN_LINK
+#endif
+//
+// And include the header that does the work:
+//
+#include <boost/config/auto_link.hpp>
+#endif // auto-linking disabled
+#endif // BOOST_CHRONO_HEADER_ONLY
+#endif // BOOST_CHRONO_CONFIG_HPP
View
31 ext/boost/chrono/detail/is_evenly_divisible_by.hpp
@@ -0,0 +1,31 @@
+// is_evenly_divisible_by.hpp --------------------------------------------------------------//
+
+// Copyright 2009-2010 Vicente J. Botet Escriba
+
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+#ifndef BOOST_CHRONO_DETAIL_IS_EVENLY_DIVISIBLE_BY_HPP
+#define BOOST_CHRONO_DETAIL_IS_EVENLY_DIVISIBLE_BY_HPP
+
+#include <boost/chrono/config.hpp>
+
+#include <boost/mpl/logical.hpp>
+#include <boost/ratio/detail/overflow_helpers.hpp>
+
+namespace boost {
+namespace chrono {
+namespace chrono_detail {
+
+// template <class R1, class R2>
+// struct is_evenly_divisible_by : public boost::mpl::bool_ < ratio_divide<R1, R2>::type::den == 1 >
+// {};
+ template <class R1, class R2>
+ struct is_evenly_divisible_by : public boost::ratio_detail::is_evenly_divisible_by<R1, R2>
+ {};
+
+} // namespace chrono_detail
+} // namespace detail
+} // namespace chrono
+
+#endif // BOOST_CHRONO_DETAIL_IS_EVENLY_DIVISIBLE_BY_HPP
View
30 ext/boost/chrono/detail/static_assert.hpp
@@ -0,0 +1,30 @@
+// static_assert.hpp --------------------------------------------------------------//
+
+// Copyright 2009-2010 Vicente J. Botet Escriba
+
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+
+#ifndef BOOST_CHRONO_DETAIL_STATIC_ASSERT_HPP
+#define BOOST_CHRONO_DETAIL_STATIC_ASSERT_HPP
+
+#include <boost/chrono/config.hpp>
+
+#ifndef BOOST_NO_STATIC_ASSERT
+#define BOOST_CHRONO_STATIC_ASSERT(CND, MSG, TYPES) static_assert(CND,MSG)
+#elif defined(BOOST_CHRONO_USES_STATIC_ASSERT)
+#include <boost/static_assert.hpp>
+#define BOOST_CHRONO_STATIC_ASSERT(CND, MSG, TYPES) BOOST_STATIC_ASSERT(CND)
+#elif defined(BOOST_CHRONO_USES_MPL_ASSERT)
+#include <boost/mpl/assert.hpp>
+#include <boost/mpl/bool.hpp>
+#define BOOST_CHRONO_STATIC_ASSERT(CND, MSG, TYPES) \
+ BOOST_MPL_ASSERT_MSG(boost::mpl::bool_< (CND) >::type::value, MSG, TYPES)
+#else
+//~ #elif defined(BOOST_CHRONO_USES_ARRAY_ASSERT)
+#define BOOST_CHRONO_STATIC_ASSERT(CND, MSG, TYPES) static char BOOST_JOIN(boost_chrono_test_,__LINE__)[(CND)?1:-1]
+//~ #define BOOST_CHRONO_STATIC_ASSERT(CND, MSG, TYPES)
+#endif
+
+#endif // BOOST_CHRONO_DETAIL_STATIC_ASSERT_HPP
View
29 ext/boost/chrono/detail/system.hpp
@@ -0,0 +1,29 @@
+// Copyright 2009-2010 Vicente J. Botet Escriba
+
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+#ifndef BOOST_CHRONO_DETAIL_SYSTEM_HPP
+#define BOOST_CHRONO_DETAIL_SYSTEM_HPP
+
+#if !defined BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
+
+#include <boost/version.hpp>
+#include <boost/system/error_code.hpp>
+
+#if ((BOOST_VERSION / 100000) < 2) && ((BOOST_VERSION / 100 % 1000) < 44)
+#define BOOST_CHRONO_SYSTEM_CATEGORY boost::system::system_category
+#else
+#define BOOST_CHRONO_SYSTEM_CATEGORY boost::system::system_category()
+#endif
+
+#ifdef BOOST_SYSTEM_NO_DEPRECATED
+#define BOOST_CHRONO_THROWS boost::throws()
+#define BOOST_CHRONO_IS_THROWS(EC) (&EC==&boost::throws())
+#else
+#define BOOST_CHRONO_THROWS boost::system::throws
+#define BOOST_CHRONO_IS_THROWS(EC) (&EC==&boost::system::throws)
+#endif
+
+#endif
+#endif
View
795 ext/boost/chrono/duration.hpp
@@ -0,0 +1,795 @@
+// duration.hpp --------------------------------------------------------------//
+
+// Copyright 2008 Howard Hinnant
+// Copyright 2008 Beman Dawes
+// Copyright 2009-2011 Vicente J. Botet Escriba
+
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+/*
+
+This code was derived by Beman Dawes from Howard Hinnant's time2_demo prototype.
+Many thanks to Howard for making his code available under the Boost license.
+The original code was modified to conform to Boost conventions and to section
+20.9 Time utilities [time] of the C++ committee's working paper N2798.
+See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2798.pdf.
+
+time2_demo contained this comment:
+
+ Much thanks to Andrei Alexandrescu,
+ Walter Brown,
+ Peter Dimov,
+ Jeff Garland,
+ Terry Golubiewski,
+ Daniel Krugler,
+ Anthony Williams.
+*/
+
+
+#ifndef BOOST_CHRONO_DURATION_HPP
+#define BOOST_CHRONO_DURATION_HPP
+
+#include <boost/chrono/config.hpp>
+#include <boost/chrono/detail/static_assert.hpp>
+
+#include <climits>
+#include <limits>
+
+
+#include <boost/mpl/logical.hpp>
+#include <boost/ratio/ratio.hpp>
+#include <boost/type_traits/common_type.hpp>
+#include <boost/type_traits/is_arithmetic.hpp>
+#include <boost/type_traits/is_convertible.hpp>
+#include <boost/type_traits/is_floating_point.hpp>
+#include <boost/type_traits/is_unsigned.hpp>
+#include <boost/chrono/detail/is_evenly_divisible_by.hpp>
+
+#include <boost/cstdint.hpp>
+#include <boost/utility/enable_if.hpp>
+#include <boost/detail/workaround.hpp>
+#include <boost/integer_traits.hpp>
+
+#if !defined(BOOST_NO_STATIC_ASSERT) || !defined(BOOST_CHRONO_USES_MPL_ASSERT)
+#define BOOST_CHRONO_A_DURATION_REPRESENTATION_CAN_NOT_BE_A_DURATION "A duration representation can not be a duration"
+#define BOOST_CHRONO_SECOND_TEMPLATE_PARAMETER_OF_DURATION_MUST_BE_A_STD_RATIO "Second template parameter of duration must be a boost::ratio"
+#define BOOST_CHRONO_DURATION_PERIOD_MUST_BE_POSITIVE "duration period must be positive"
+#define BOOST_CHRONO_SECOND_TEMPLATE_PARAMETER_OF_TIME_POINT_MUST_BE_A_BOOST_CHRONO_DURATION "Second template parameter of time_point must be a boost::chrono::duration"
+#endif
+
+#ifndef BOOST_CHRONO_HEADER_ONLY
+// this must occur after all of the includes and before any code appears:
+#include <boost/config/abi_prefix.hpp> // must be the last #include
+#endif
+
+//----------------------------------------------------------------------------//
+// //
+// 20.9 Time utilities [time] //
+// synopsis //
+// //
+//----------------------------------------------------------------------------//
+
+namespace boost {
+namespace chrono {
+
+ template <class Rep, class Period = ratio<1> >
+ class duration;
+
+ namespace detail
+ {
+ template <class T>
+ struct is_duration
+ : boost::false_type {};
+
+ template <class Rep, class Period>
+ struct is_duration<duration<Rep, Period> >
+ : boost::true_type {};
+
+ template <class Duration, class Rep, bool = is_duration<Rep>::value>
+ struct duration_divide_result
+ {
+ };
+
+ template <class Duration, class Rep2,
+ bool = (
+ ((boost::is_convertible<typename Duration::rep,
+ typename common_type<typename Duration::rep, Rep2>::type>::value))
+ && ((boost::is_convertible<Rep2,
+ typename common_type<typename Duration::rep, Rep2>::type>::value))
+ )
+ >
+ struct duration_divide_imp
+ {
+ };
+
+ template <class Rep1, class Period, class Rep2>
+ struct duration_divide_imp<duration<Rep1, Period>, Rep2, true>
+ {
+ typedef duration<typename common_type<Rep1, Rep2>::type, Period> type;
+ };
+
+ template <class Rep1, class Period, class Rep2>
+ struct duration_divide_result<duration<Rep1, Period>, Rep2, false>
+ : duration_divide_imp<duration<Rep1, Period>, Rep2>
+ {
+ };
+
+///
+ template <class Rep, class Duration, bool = is_duration<Rep>::value>
+ struct duration_divide_result2
+ {
+ };
+
+ template <class Rep, class Duration,
+ bool = (
+ ((boost::is_convertible<typename Duration::rep,
+ typename common_type<typename Duration::rep, Rep>::type>::value))
+ && ((boost::is_convertible<Rep,
+ typename common_type<typename Duration::rep, Rep>::type>::value))
+ )
+ >
+ struct duration_divide_imp2
+ {
+ };
+
+ template <class Rep1, class Rep2, class Period >
+ struct duration_divide_imp2<Rep1, duration<Rep2, Period>, true>
+ {
+ //typedef typename common_type<Rep1, Rep2>::type type;
+ typedef double type;
+ };
+
+ template <class Rep1, class Rep2, class Period >
+ struct duration_divide_result2<Rep1, duration<Rep2, Period>, false>
+ : duration_divide_imp2<Rep1, duration<Rep2, Period> >
+ {
+ };
+
+///
+ template <class Duration, class Rep, bool = is_duration<Rep>::value>
+ struct duration_modulo_result
+ {
+ };
+
+ template <class Duration, class Rep2,
+ bool = (
+ //boost::is_convertible<typename Duration::rep,
+ //typename common_type<typename Duration::rep, Rep2>::type>::value
+ //&&
+ boost::is_convertible<Rep2,
+ typename common_type<typename Duration::rep, Rep2>::type>::value
+ )
+ >
+ struct duration_modulo_imp
+ {
+ };
+
+ template <class Rep1, class Period, class Rep2>
+ struct duration_modulo_imp<duration<Rep1, Period>, Rep2, true>
+ {
+ typedef duration<typename common_type<Rep1, Rep2>::type, Period> type;
+ };
+
+ template <class Rep1, class Period, class Rep2>
+ struct duration_modulo_result<duration<Rep1, Period>, Rep2, false>
+ : duration_modulo_imp<duration<Rep1, Period>, Rep2>
+ {
+ };
+
+} // namespace detail
+} // namespace chrono
+
+
+// common_type trait specializations
+
+template <class Rep1, class Period1, class Rep2, class Period2>
+struct common_type<chrono::duration<Rep1, Period1>,
+ chrono::duration<Rep2, Period2> >;
+
+
+namespace chrono {
+
+ // customization traits
+ template <class Rep> struct treat_as_floating_point;
+ template <class Rep> struct duration_values;
+
+ // convenience typedefs
+ typedef duration<boost::int_least64_t, nano> nanoseconds; // at least 64 bits needed
+ typedef duration<boost::int_least64_t, micro> microseconds; // at least 55 bits needed
+ typedef duration<boost::int_least64_t, milli> milliseconds; // at least 45 bits needed
+ typedef duration<boost::int_least64_t> seconds; // at least 35 bits needed
+ typedef duration<boost::int_least32_t, ratio< 60> > minutes; // at least 29 bits needed
+ typedef duration<boost::int_least32_t, ratio<3600> > hours; // at least 23 bits needed
+
+//----------------------------------------------------------------------------//
+// duration helpers //
+//----------------------------------------------------------------------------//
+
+namespace detail
+{
+
+ // duration_cast
+
+ // duration_cast is the heart of this whole prototype. It can convert any
+ // duration to any other. It is also (implicitly) used in converting
+ // time_points. The conversion is always exact if possible. And it is
+ // always as efficient as hand written code. If different representations
+ // are involved, care is taken to never require implicit conversions.
+ // Instead static_cast is used explicitly for every required conversion.
+ // If there are a mixture of integral and floating point representations,
+ // the use of common_type ensures that the most logical "intermediate"
+ // representation is used.
+ template <class FromDuration, class ToDuration,
+ class Period,
+ bool PeriodNumEq1,
+ bool PeriodDenEq1>
+ struct duration_cast_aux;
+
+ // When the two periods are the same, all that is left to do is static_cast from
+ // the source representation to the target representation (which may be a no-op).
+ // This conversion is always exact as long as the static_cast from the source
+ // representation to the destination representation is exact.
+ template <class FromDuration, class ToDuration, class Period>
+ struct duration_cast_aux<FromDuration, ToDuration, Period, true, true>
+ {
+ BOOST_CONSTEXPR ToDuration operator()(const FromDuration& fd) const
+ {
+ return ToDuration(static_cast<typename ToDuration::rep>(fd.count()));
+ }
+ };
+
+ // When the numerator of FromPeriod / ToPeriod is 1, then all we need to do is
+ // divide by the denominator of FromPeriod / ToPeriod. The common_type of
+ // the two representations is used for the intermediate computation before
+ // static_cast'ing to the destination.
+ // This conversion is generally not exact because of the division (but could be
+ // if you get lucky on the run time value of fd.count()).
+ template <class FromDuration, class ToDuration, class Period>
+ struct duration_cast_aux<FromDuration, ToDuration, Period, true, false>
+ {
+ BOOST_CONSTEXPR ToDuration operator()(const FromDuration& fd) const
+ {
+ typedef typename common_type<
+ typename ToDuration::rep,
+ typename FromDuration::rep,
+ boost::intmax_t>::type C;
+ return ToDuration(static_cast<typename ToDuration::rep>(
+ static_cast<C>(fd.count()) / static_cast<C>(Period::den)));
+ }
+ };
+
+ // When the denominator of FromPeriod / ToPeriod is 1, then all we need to do is
+ // multiply by the numerator of FromPeriod / ToPeriod. The common_type of
+ // the two representations is used for the intermediate computation before
+ // static_cast'ing to the destination.
+ // This conversion is always exact as long as the static_cast's involved are exact.
+ template <class FromDuration, class ToDuration, class Period>
+ struct duration_cast_aux<FromDuration, ToDuration, Period, false, true>
+ {
+ BOOST_CONSTEXPR ToDuration operator()(const FromDuration& fd) const
+ {
+ typedef typename common_type<
+ typename ToDuration::rep,
+ typename FromDuration::rep,
+ boost::intmax_t>::type C;
+ return ToDuration(static_cast<typename ToDuration::rep>(
+ static_cast<C>(fd.count()) * static_cast<C>(Period::num)));
+ }
+ };
+
+ // When neither the numerator or denominator of FromPeriod / ToPeriod is 1, then we need to
+ // multiply by the numerator and divide by the denominator of FromPeriod / ToPeriod. The
+ // common_type of the two representations is used for the intermediate computation before
+ // static_cast'ing to the destination.
+ // This conversion is generally not exact because of the division (but could be
+ // if you get lucky on the run time value of fd.count()).
+ template <class FromDuration, class ToDuration, class Period>
+ struct duration_cast_aux<FromDuration, ToDuration, Period, false, false>
+ {
+ BOOST_CONSTEXPR ToDuration operator()(const FromDuration& fd) const
+ {
+ typedef typename common_type<
+ typename ToDuration::rep,
+ typename FromDuration::rep,
+ boost::intmax_t>::type C;
+ return ToDuration(static_cast<typename ToDuration::rep>(
+ static_cast<C>(fd.count()) * static_cast<C>(Period::num)
+ / static_cast<C>(Period::den)));
+ }
+ };
+
+ template <class FromDuration, class ToDuration>
+ struct duration_cast {
+ typedef typename ratio_divide<typename FromDuration::period,
+ typename ToDuration::period>::type Period;
+ typedef duration_cast_aux<
+ FromDuration,
+ ToDuration,
+ Period,
+ Period::num == 1,
+ Period::den == 1
+ > Aux;
+ BOOST_CONSTEXPR ToDuration operator()(const FromDuration& fd) const
+ {
+ return Aux()(fd);
+ }
+ };
+
+} // namespace detail
+
+//----------------------------------------------------------------------------//
+// //
+// 20.9.2 Time-related traits [time.traits] //
+// //
+//----------------------------------------------------------------------------//
+//----------------------------------------------------------------------------//
+// 20.9.2.1 treat_as_floating_point [time.traits.is_fp] //
+// Probably should have been treat_as_floating_point. Editor notifed. //
+//----------------------------------------------------------------------------//
+
+ // Support bidirectional (non-exact) conversions for floating point rep types
+ // (or user defined rep types which specialize treat_as_floating_point).
+ template <class Rep>
+ struct treat_as_floating_point : boost::is_floating_point<Rep> {};
+
+//----------------------------------------------------------------------------//
+// 20.9.2.2 duration_values [time.traits.duration_values] //
+//----------------------------------------------------------------------------//
+
+namespace detail {
+ template <class T, bool = is_arithmetic<T>::value>
+ struct chrono_numeric_limits {
+ static T lowest() throw() {return (std::numeric_limits<T>::min) ();}
+ };
+
+ template <class T>
+ struct chrono_numeric_limits<T,true> {
+ static T lowest() throw() {return (std::numeric_limits<T>::min) ();}
+ };
+
+ template <>
+ struct chrono_numeric_limits<float,true> {
+ static float lowest() throw()
+ {
+ return -(std::numeric_limits<float>::max) ();
+ }
+ };
+
+ template <>
+ struct chrono_numeric_limits<double,true> {
+ static double lowest() throw()
+ {
+ return -(std::numeric_limits<double>::max) ();
+ }
+ };
+
+ template <>
+ struct chrono_numeric_limits<long double,true> {
+ static long double lowest() throw()
+ {
+ return -(std::numeric_limits<long double>::max)();
+ }
+ };
+
+ template <class T>
+ struct numeric_limits : chrono_numeric_limits<typename remove_cv<T>::type>
+ {};
+
+}
+template <class Rep>
+struct duration_values
+{
+ static BOOST_CONSTEXPR Rep zero() {return Rep(0);}
+ static BOOST_CONSTEXPR Rep max BOOST_PREVENT_MACRO_SUBSTITUTION ()
+ {
+ return (std::numeric_limits<Rep>::max)();
+ }
+
+ static BOOST_CONSTEXPR Rep min BOOST_PREVENT_MACRO_SUBSTITUTION ()
+ {
+ return detail::numeric_limits<Rep>::lowest();
+ }
+};
+
+} // namespace chrono
+
+//----------------------------------------------------------------------------//
+// 20.9.2.3 Specializations of common_type [time.traits.specializations] //
+//----------------------------------------------------------------------------//
+
+template <class Rep1, class Period1, class Rep2, class Period2>
+struct common_type<chrono::duration<Rep1, Period1>,
+ chrono::duration<Rep2, Period2> >
+{
+ typedef chrono::duration<typename common_type<Rep1, Rep2>::type,
+ typename boost::ratio_gcd<Period1, Period2>::type> type;
+};
+
+
+//----------------------------------------------------------------------------//
+// //
+// 20.9.3 Class template duration [time.duration] //
+// //
+//----------------------------------------------------------------------------//
+
+
+namespace chrono {
+
+ template <class Rep, class Period>
+ class duration
+ {
+ //BOOST_CHRONO_STATIC_ASSERT(boost::is_integral<Rep>::value, BOOST_CHRONO_A_DURATION_REPRESENTATION_MUST_BE_INTEGRAL, ());
+ BOOST_CHRONO_STATIC_ASSERT(!boost::chrono::detail::is_duration<Rep>::value,
+ BOOST_CHRONO_A_DURATION_REPRESENTATION_CAN_NOT_BE_A_DURATION, ());
+ BOOST_CHRONO_STATIC_ASSERT(boost::ratio_detail::is_ratio<typename Period::type>::value,
+ BOOST_CHRONO_SECOND_TEMPLATE_PARAMETER_OF_DURATION_MUST_BE_A_STD_RATIO, ());
+ BOOST_CHRONO_STATIC_ASSERT(Period::num>0,
+ BOOST_CHRONO_DURATION_PERIOD_MUST_BE_POSITIVE, ());
+ public:
+ typedef Rep rep;
+ typedef Period period;
+ private:
+ rep rep_;
+ public:
+
+ BOOST_CONSTEXPR
+ duration() : rep_(duration_values<rep>::zero()) { }
+ template <class Rep2>
+ BOOST_CONSTEXPR
+ explicit duration(const Rep2& r
+ , typename boost::enable_if <
+ mpl::and_ <
+ boost::is_convertible<Rep2, rep>,
+ mpl::or_ <
+ treat_as_floating_point<rep>,
+ mpl::and_ <
+ mpl::not_ < treat_as_floating_point<rep> >,
+ mpl::not_ < treat_as_floating_point<Rep2> >
+ >
+ >
+ >
+ >::type* = 0
+ ) : rep_(r) { }
+ //~duration() {} //= default;
+ BOOST_CONSTEXPR
+ duration(const duration& rhs) : rep_(rhs.rep_) {} // = default;
+ duration& operator=(const duration& rhs) // = default;
+ {
+ if (&rhs != this) rep_= rhs.rep_;
+ return *this;
+ }
+
+ // conversions
+ template <class Rep2, class Period2>
+ BOOST_CONSTEXPR
+ duration(const duration<Rep2, Period2>& d
+ , typename boost::enable_if <
+ mpl::or_ <
+ treat_as_floating_point<rep>,
+ mpl::and_ <
+ chrono_detail::is_evenly_divisible_by<Period2, period>,
+ mpl::not_ < treat_as_floating_point<Rep2> >
+ >
+ >
+ >::type* = 0
+ )
+ : rep_(chrono::detail::duration_cast<duration<Rep2, Period2>, duration>()(d).count()) {}
+
+ // observer
+
+ BOOST_CONSTEXPR
+ rep count() const {return rep_;}
+
+ // arithmetic
+
+ BOOST_CONSTEXPR
+ duration operator+() const {return *this;}
+ BOOST_CONSTEXPR
+ duration operator-() const {return duration(-rep_);}
+ duration& operator++() {++rep_; return *this;}
+ duration operator++(int) {return duration(rep_++);}
+ duration& operator--() {--rep_; return *this;}
+ duration operator--(int) {return duration(rep_--);}
+
+ duration& operator+=(const duration& d)
+ {
+ rep_ += d.count(); return *this;
+ }
+ duration& operator-=(const duration& d)
+ {
+ rep_ -= d.count(); return *this;
+ }
+
+ duration& operator*=(const rep& rhs) {rep_ *= rhs; return *this;}
+ duration& operator/=(const rep& rhs) {rep_ /= rhs; return *this;}
+ duration& operator%=(const rep& rhs) {rep_ %= rhs; return *this;}
+ duration& operator%=(const duration& rhs)
+ {
+ rep_ %= rhs.count(); return *this;
+ }
+ // 20.9.3.4 duration special values [time.duration.special]
+
+ static BOOST_CONSTEXPR duration zero()
+ {
+ return duration(duration_values<rep>::zero());
+ }
+ static BOOST_CONSTEXPR duration min BOOST_PREVENT_MACRO_SUBSTITUTION ()
+ {
+ return duration((duration_values<rep>::min)());
+ }
+ static BOOST_CONSTEXPR duration max BOOST_PREVENT_MACRO_SUBSTITUTION ()
+ {
+ return duration((duration_values<rep>::max)());
+ }
+ };
+
+//----------------------------------------------------------------------------//
+// 20.9.3.5 duration non-member arithmetic [time.duration.nonmember] //
+//----------------------------------------------------------------------------//
+
+ // Duration +
+
+ template <class Rep1, class Period1, class Rep2, class Period2>
+ inline BOOST_CONSTEXPR
+ typename common_type<duration<Rep1, Period1>, duration<Rep2, Period2> >::type
+ operator+(const duration<Rep1, Period1>& lhs,
+ const duration<Rep2, Period2>& rhs)
+ {
+ typedef typename common_type<duration<Rep1, Period1>,
+ duration<Rep2, Period2> >::type CD;
+ return CD(CD(lhs).count()+CD(rhs).count());
+ }
+
+ // Duration -
+
+ template <class Rep1, class Period1, class Rep2, class Period2>
+ inline BOOST_CONSTEXPR
+ typename common_type<duration<Rep1, Period1>, duration<Rep2, Period2> >::type
+ operator-(const duration<Rep1, Period1>& lhs,
+ const duration<Rep2, Period2>& rhs)
+ {
+ typedef typename common_type<duration<Rep1, Period1>,
+ duration<Rep2, Period2> >::type CD;
+ return CD(CD(lhs).count()-CD(rhs).count());
+ }
+
+ // Duration *
+
+ template <class Rep1, class Period, class Rep2>
+ inline BOOST_CONSTEXPR
+ typename boost::enable_if <
+ mpl::and_ <
+ boost::is_convertible<Rep1, typename common_type<Rep1, Rep2>::type>,