You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

585 lines
18 KiB

  1. /* /////////////////////////////////////////////////////////////////////////
  2. * File: stlsoft/conversion/truncation_test.hpp
  3. *
  4. * Purpose: Runtime checking for numeric conversions.
  5. *
  6. * Created: 10th August 2006
  7. * Updated: 24th November 2011
  8. *
  9. * Home: http://stlsoft.org/
  10. *
  11. * Copyright (c) 2006-2011, Matthew Wilson and Synesis Software
  12. * All rights reserved.
  13. *
  14. * Redistribution and use in source and binary forms, with or without
  15. * modification, are permitted provided that the following conditions are met:
  16. *
  17. * - Redistributions of source code must retain the above copyright notice, this
  18. * list of conditions and the following disclaimer.
  19. * - Redistributions in binary form must reproduce the above copyright notice,
  20. * this list of conditions and the following disclaimer in the documentation
  21. * and/or other materials provided with the distribution.
  22. * - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of
  23. * any contributors may be used to endorse or promote products derived from
  24. * this software without specific prior written permission.
  25. *
  26. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  27. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  28. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  29. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  30. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  31. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  32. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  33. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  34. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  35. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  36. * POSSIBILITY OF SUCH DAMAGE.
  37. *
  38. * ////////////////////////////////////////////////////////////////////// */
  39. /** \file stlsoft/conversion/truncation_test.hpp
  40. *
  41. * \brief [C++ only] Definition of the stlsoft::truncation_test functions
  42. * (\ref group__library__conversion "Conversion" Library).
  43. */
  44. #ifndef STLSOFT_INCL_STLSOFT_CONVERSION_HPP_TRUNCATION_TEST
  45. #define STLSOFT_INCL_STLSOFT_CONVERSION_HPP_TRUNCATION_TEST
  46. #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
  47. # define STLSOFT_VER_STLSOFT_CONVERSION_HPP_TRUNCATION_TEST_MAJOR 1
  48. # define STLSOFT_VER_STLSOFT_CONVERSION_HPP_TRUNCATION_TEST_MINOR 0
  49. # define STLSOFT_VER_STLSOFT_CONVERSION_HPP_TRUNCATION_TEST_REVISION 6
  50. # define STLSOFT_VER_STLSOFT_CONVERSION_HPP_TRUNCATION_TEST_EDIT 48
  51. #endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
  52. /* /////////////////////////////////////////////////////////////////////////
  53. * Auto-generation and compatibility
  54. */
  55. /*
  56. */
  57. /* /////////////////////////////////////////////////////////////////////////
  58. * Includes
  59. */
  60. #ifndef STLSOFT_INCL_STLSOFT_H_STLSOFT
  61. # include <stlsoft/stlsoft.h>
  62. #endif /* !STLSOFT_INCL_STLSOFT_H_STLSOFT */
  63. #ifndef STLSOFT_INCL_STLSOFT_UTIL_H_LIMIT_TRAITS
  64. # include <stlsoft/util/limit_traits.h>
  65. #endif /* !STLSOFT_INCL_STLSOFT_UTIL_H_LIMIT_TRAITS */
  66. #ifndef STLSOFT_INCL_STLSOFT_UTIL_HPP_SIGN_TRAITS
  67. # include <stlsoft/util/sign_traits.hpp>
  68. #endif /* !STLSOFT_INCL_STLSOFT_UTIL_HPP_SIGN_TRAITS */
  69. #ifndef STLSOFT_INCL_STLSOFT_META_HPP_IS_INTEGRAL_TYPE
  70. # include <stlsoft/meta/is_integral_type.hpp>
  71. #endif /* !STLSOFT_INCL_STLSOFT_META_HPP_IS_INTEGRAL_TYPE */
  72. #ifndef STLSOFT_INCL_STLSOFT_META_HPP_IS_SIGNED_TYPE
  73. # include <stlsoft/meta/is_signed_type.hpp>
  74. #endif /* !STLSOFT_INCL_STLSOFT_META_HPP_IS_SIGNED_TYPE */
  75. #ifdef STLSOFT_UNITTEST
  76. # include <limits.h>
  77. #endif /* STLSOFT_UNITTEST */
  78. #if defined(STLSOFT_UNITTEST) || \
  79. defined(_DEBUG)
  80. # include <typeinfo>
  81. # if defined(STLSOFT_COMPILER_IS_MSVC)
  82. # include <crtdbg.h>
  83. # endif /* VC++ */
  84. #endif /* STLSOFT_UNITTEST || _DEBUG */
  85. /* /////////////////////////////////////////////////////////////////////////
  86. * Namespace
  87. */
  88. #ifndef _STLSOFT_NO_NAMESPACE
  89. namespace stlsoft
  90. {
  91. #endif /* _STLSOFT_NO_NAMESPACE */
  92. /* /////////////////////////////////////////////////////////////////////////
  93. * Functions
  94. *
  95. *
  96. * Assume 11 types:
  97. * char, signed char, unsigned char
  98. * short, unsigned short
  99. * int, unsigned int
  100. * long, unsigned long
  101. * long long, unsigned long long
  102. *
  103. * That gives 121 permutations:
  104. * (a) 11 where the type is the same
  105. * (b) 20 where the sign is the same and sizeof(FROM) <= sizeof(TO); superset of (a)
  106. * (c) 10 where FROM is unsigned and sizeof(FROM) < sizeof(TO)
  107. * (d) 80 that must be determined dynamically
  108. *
  109. *
  110. * The strategy is as follows:
  111. *
  112. if( signof(FROM) == signof(TO) && // Compile-time test 1
  113. sizeof(FROM) <= sizeof(TO))
  114. {
  115. return true;
  116. }
  117. else if(unsigned == signof(FROM) && // Compile-time test 2
  118. sizeof(FROM) < sizeof(TO))
  119. {
  120. return true;
  121. }
  122. else
  123. {
  124. return runtime_test<TO>(from);
  125. }
  126. *
  127. * The runtime test evaluates to the following:
  128. *
  129. * If the FROM type is signed, then
  130. */
  131. #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
  132. // The permutations are:
  133. //
  134. // 1a FROM signed | TO signed | sizeof(FROM) < sizeof(TO) => Always yes
  135. // 1b FROM signed | TO signed | sizeof(FROM) = sizeof(TO) => Always yes
  136. // 1c FROM signed | TO signed | sizeof(FROM) > sizeof(TO) => Runtime test
  137. //
  138. // 2a FROM unsigned | TO signed | sizeof(FROM) < sizeof(TO) => Always yes
  139. // 2b FROM unsigned | TO signed | sizeof(FROM) = sizeof(TO) => Runtime test
  140. // 2c FROM unsigned | TO signed | sizeof(FROM) > sizeof(TO) => Runtime test
  141. //
  142. // 3a FROM signed | TO unsigned | sizeof(FROM) < sizeof(TO) => Runtime test
  143. // 3b FROM signed | TO unsigned | sizeof(FROM) = sizeof(TO) => Runtime test
  144. // 3c FROM signed | TO unsigned | sizeof(FROM) > sizeof(TO) => Runtime test
  145. //
  146. // 4a FROM unsigned | TO unsigned | sizeof(FROM) < sizeof(TO) => Always yes
  147. // 4b FROM unsigned | TO unsigned | sizeof(FROM) = sizeof(TO) => Always yes
  148. // 4c FROM unsigned | TO unsigned | sizeof(FROM) > sizeof(TO) => Runtime test
  149. template< ss_typename_param_k TO
  150. , ss_typename_param_k FROM
  151. >
  152. inline bool truncation_test_helper_runtime_test_different_sign_FROM_is_signed(FROM from, yes_type, TO)
  153. {
  154. #ifdef _DEBUG
  155. # if defined(STLSOFT_COMPILER_IS_MSVC)
  156. int const flags = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
  157. _CrtSetDbgFlag(flags & ~(_CRTDBG_ALLOC_MEM_DF));
  158. # endif /* VC++ */
  159. char const* TO_ = typeid(TO).name();
  160. char const* FROM_ = typeid(FROM).name();
  161. STLSOFT_SUPPRESS_UNUSED(TO_);
  162. STLSOFT_SUPPRESS_UNUSED(FROM_);
  163. # if defined(STLSOFT_COMPILER_IS_MSVC)
  164. _CrtSetDbgFlag(flags);
  165. # endif /* VC++ */
  166. #endif /* _DEBUG */
  167. enum { TO_is_signed = is_signed_type<TO>::value };
  168. enum { FROM_is_signed = is_signed_type<FROM>::value };
  169. const ss_size_t sizeofFROM = sizeof(FROM);
  170. const ss_size_t sizeofTO = sizeof(TO);
  171. STLSOFT_SUPPRESS_UNUSED(sizeofFROM);
  172. STLSOFT_SUPPRESS_UNUSED(sizeofTO);
  173. STLSOFT_STATIC_ASSERT((0 == int(TO_is_signed)) != (0 == int(FROM_is_signed)));
  174. STLSOFT_STATIC_ASSERT(0 != int(FROM_is_signed));
  175. STLSOFT_STATIC_ASSERT(0 == int(TO_is_signed));
  176. // FROM is signed
  177. // TO is unsigned
  178. //
  179. // Truncation occurs if:
  180. //
  181. // - from < 0
  182. // - from > toMax
  183. // - from
  184. if(from < 0)
  185. {
  186. return false;
  187. }
  188. else if(sizeofFROM < sizeofTO) // 3a
  189. {
  190. return true;
  191. }
  192. else
  193. {
  194. if(sizeofFROM == sizeofTO)
  195. {
  196. TO toMax = limit_traits<TO>::maximum();
  197. if(toMax < static_cast<TO>(from))
  198. {
  199. return false;
  200. }
  201. else
  202. {
  203. return true;
  204. }
  205. }
  206. else // 3b & 3c
  207. {
  208. FROM toMax = static_cast<FROM>(limit_traits<TO>::maximum());
  209. if(from > toMax)
  210. {
  211. return false;
  212. }
  213. else
  214. {
  215. return true;
  216. }
  217. }
  218. }
  219. }
  220. template< ss_typename_param_k TO
  221. , ss_typename_param_k FROM
  222. >
  223. inline bool truncation_test_helper_runtime_test_different_sign_FROM_is_signed(FROM from, no_type, TO)
  224. {
  225. #ifdef _DEBUG
  226. # if defined(STLSOFT_COMPILER_IS_MSVC)
  227. int const flags = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
  228. _CrtSetDbgFlag(flags & ~(_CRTDBG_ALLOC_MEM_DF));
  229. # endif /* VC++ */
  230. char const* TO_ = typeid(TO).name();
  231. char const* FROM_ = typeid(FROM).name();
  232. STLSOFT_SUPPRESS_UNUSED(TO_);
  233. STLSOFT_SUPPRESS_UNUSED(FROM_);
  234. # if defined(STLSOFT_COMPILER_IS_MSVC)
  235. _CrtSetDbgFlag(flags);
  236. # endif /* VC++ */
  237. #endif /* _DEBUG */
  238. enum { TO_is_signed = is_signed_type<TO>::value };
  239. enum { FROM_is_signed = is_signed_type<FROM>::value };
  240. const ss_size_t sizeofFROM = sizeof(FROM);
  241. const ss_size_t sizeofTO = sizeof(TO);
  242. STLSOFT_SUPPRESS_UNUSED(sizeofFROM);
  243. STLSOFT_SUPPRESS_UNUSED(sizeofTO);
  244. STLSOFT_STATIC_ASSERT((0 == int(TO_is_signed)) != (0 == int(FROM_is_signed)));
  245. STLSOFT_STATIC_ASSERT(0 == int(FROM_is_signed));
  246. STLSOFT_STATIC_ASSERT(0 != int(TO_is_signed));
  247. // FROM is unsigned
  248. // TO is signed
  249. //
  250. // Truncation occurs if from > toMax
  251. FROM toMax = static_cast<FROM>(limit_traits<TO>::maximum());
  252. if(from > toMax)
  253. {
  254. return false;
  255. }
  256. else
  257. {
  258. return true;
  259. }
  260. }
  261. template< ss_typename_param_k TO
  262. , ss_typename_param_k FROM
  263. >
  264. inline bool truncation_test_helper_runtime_test_same_sign(FROM from, yes_type, TO) // The use of the dummy variable is to fix a bug with VC++ 5-7.0
  265. {
  266. #ifdef _DEBUG
  267. # if defined(STLSOFT_COMPILER_IS_MSVC)
  268. int const flags = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
  269. _CrtSetDbgFlag(flags & ~(_CRTDBG_ALLOC_MEM_DF));
  270. # endif /* VC++ */
  271. char const* TO_ = typeid(TO).name();
  272. char const* FROM_ = typeid(FROM).name();
  273. STLSOFT_SUPPRESS_UNUSED(TO_);
  274. STLSOFT_SUPPRESS_UNUSED(FROM_);
  275. # if defined(STLSOFT_COMPILER_IS_MSVC)
  276. _CrtSetDbgFlag(flags);
  277. # endif /* VC++ */
  278. #endif /* _DEBUG */
  279. const ss_size_t sizeofFROM = sizeof(FROM);
  280. const ss_size_t sizeofTO = sizeof(TO);
  281. STLSOFT_STATIC_ASSERT(sizeofTO < sizeofFROM);
  282. // This is a fully runtime test: does FROM fit into TO's limits?
  283. //
  284. // To do this we elicit TO's min and max. The values are held in
  285. // FROM, which involves no truncation because sizeof(FROM) > sizeof(TO)
  286. FROM toMax = static_cast<FROM>(limit_traits<TO>::maximum());
  287. FROM toMin = static_cast<FROM>(limit_traits<TO>::minimum());
  288. if( from < toMin ||
  289. from > toMax)
  290. {
  291. return false;
  292. }
  293. else
  294. {
  295. return true;
  296. }
  297. }
  298. template< ss_typename_param_k TO
  299. , ss_typename_param_k FROM
  300. >
  301. inline bool truncation_test_helper_runtime_test_same_sign(FROM from, no_type, TO)
  302. {
  303. #ifdef _DEBUG
  304. # if defined(STLSOFT_COMPILER_IS_MSVC)
  305. int const flags = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
  306. _CrtSetDbgFlag(flags & ~(_CRTDBG_ALLOC_MEM_DF));
  307. # endif /* VC++ */
  308. char const* TO_ = typeid(TO).name();
  309. char const* FROM_ = typeid(FROM).name();
  310. STLSOFT_SUPPRESS_UNUSED(TO_);
  311. STLSOFT_SUPPRESS_UNUSED(FROM_);
  312. # if defined(STLSOFT_COMPILER_IS_MSVC)
  313. _CrtSetDbgFlag(flags);
  314. # endif /* VC++ */
  315. #endif /* _DEBUG */
  316. enum { TO_is_signed = is_signed_type<TO>::value };
  317. enum { FROM_is_signed = is_signed_type<FROM>::value };
  318. const ss_size_t sizeofFROM = sizeof(FROM);
  319. const ss_size_t sizeofTO = sizeof(TO);
  320. STLSOFT_SUPPRESS_UNUSED(sizeofFROM);
  321. STLSOFT_SUPPRESS_UNUSED(sizeofTO);
  322. STLSOFT_STATIC_ASSERT((0 == int(TO_is_signed)) != (0 == int(FROM_is_signed)));
  323. typedef ss_typename_param_k value_to_yesno_type<FROM_is_signed>::type same_sign_yesno_t;
  324. return truncation_test_helper_runtime_test_different_sign_FROM_is_signed<TO>(from, same_sign_yesno_t(), TO());
  325. }
  326. template< ss_typename_param_k TO
  327. , ss_typename_param_k FROM
  328. >
  329. inline bool truncation_test_helper_runtime_test(FROM from, no_type, TO ) // The use of the dummy variable is to fix a bug with VC++ 5-7.0
  330. {
  331. #ifdef _DEBUG
  332. # if defined(STLSOFT_COMPILER_IS_MSVC)
  333. int const flags = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
  334. _CrtSetDbgFlag(flags & ~(_CRTDBG_ALLOC_MEM_DF));
  335. # endif /* VC++ */
  336. char const* TO_ = typeid(TO).name();
  337. char const* FROM_ = typeid(FROM).name();
  338. STLSOFT_SUPPRESS_UNUSED(TO_);
  339. STLSOFT_SUPPRESS_UNUSED(FROM_);
  340. # if defined(STLSOFT_COMPILER_IS_MSVC)
  341. _CrtSetDbgFlag(flags);
  342. # endif /* VC++ */
  343. #endif /* _DEBUG */
  344. // Types are different
  345. // Next test for same sign
  346. enum { TO_is_signed = is_signed_type<TO>::value };
  347. enum { FROM_is_signed = is_signed_type<FROM>::value };
  348. enum { types_have_same_sign = int(TO_is_signed) == int(FROM_is_signed) };
  349. const ss_size_t sizeofFROM = sizeof(FROM);
  350. const ss_size_t sizeofTO = sizeof(TO);
  351. STLSOFT_STATIC_ASSERT(sizeofFROM >= sizeofTO || FROM_is_signed);
  352. typedef ss_typename_param_k value_to_yesno_type<types_have_same_sign>::type same_sign_yesno_t;
  353. return truncation_test_helper_runtime_test_same_sign<TO>(from, same_sign_yesno_t(), TO());
  354. }
  355. template <typename T>
  356. inline bool truncation_test_helper_runtime_test(T, yes_type, ...)
  357. {
  358. return true;
  359. }
  360. template< ss_typename_param_k TO
  361. , ss_typename_param_k FROM
  362. >
  363. inline bool truncation_test_(FROM from, TO dummy = TO()) // The use of the dummy variable is to fix a bug with VC++ 5-7.0
  364. {
  365. #ifdef _DEBUG
  366. # if defined(STLSOFT_COMPILER_IS_MSVC)
  367. int const flags = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
  368. _CrtSetDbgFlag(flags & ~(_CRTDBG_ALLOC_MEM_DF));
  369. # endif /* VC++ */
  370. char const* TO_ = typeid(TO).name();
  371. char const* FROM_ = typeid(FROM).name();
  372. STLSOFT_SUPPRESS_UNUSED(TO_);
  373. STLSOFT_SUPPRESS_UNUSED(FROM_);
  374. # if defined(STLSOFT_COMPILER_IS_MSVC)
  375. _CrtSetDbgFlag(flags);
  376. # endif /* VC++ */
  377. #endif /* _DEBUG */
  378. // First, we must check that the types are compatible, with constraints
  379. // Both types must be integral
  380. STLSOFT_STATIC_ASSERT(0 != is_integral_type<TO>::value);
  381. STLSOFT_STATIC_ASSERT(0 != is_integral_type<FROM>::value);
  382. // Now calculate the sizes
  383. const ss_size_t sizeofFROM = sizeof(FROM);
  384. const ss_size_t sizeofTO = sizeof(TO);
  385. // Now determine the signs
  386. enum { TO_is_signed = is_signed_type<TO>::value };
  387. enum { FROM_is_signed = is_signed_type<FROM>::value };
  388. // We know at compile time that FROM fits into TO if:
  389. //
  390. // - they have the same sign, and sizeof(FROM) <= sizeof(TO), OR
  391. // - FROM is unsigned (and TO is signed), and sizeof(FROM) < sizeof(TO)
  392. //
  393. // If either of these hold, then the answer is true: the yes_type overload
  394. // of truncation_test_helper_runtime_test() is selected.
  395. //
  396. // If not, then a runtime test is required: the no_type overload
  397. // of truncation_test_helper_runtime_test() is selected.
  398. enum { types_are_statically_compatible =
  399. ( int(TO_is_signed) == int(FROM_is_signed) &&
  400. sizeofFROM <= sizeofTO)
  401. ||
  402. ( !FROM_is_signed &&
  403. sizeofFROM < sizeofTO) };
  404. typedef ss_typename_param_k value_to_yesno_type<types_are_statically_compatible>::type yesno_t;
  405. # if defined(STLSOFT_COMPILER_IS_MSVC) && \
  406. defined(_Wp64) && \
  407. !defined(_WIN64)
  408. # pragma warning(push)
  409. # pragma warning(disable : 4267)
  410. # endif /* VC++ + Win32 + _Wp32 */
  411. return truncation_test_helper_runtime_test<TO>(from, yesno_t(), dummy);
  412. # if defined(STLSOFT_COMPILER_IS_MSVC) && \
  413. defined(_Wp64) && \
  414. !defined(_WIN64)
  415. # pragma warning(pop)
  416. # endif /* VC++ + Win32 + _Wp32 */
  417. }
  418. #if 0
  419. template<ss_typename_param_k TO>
  420. class truncation_test
  421. {
  422. public:
  423. template <ss_typename_param_k FROM>
  424. truncation_test(FROM from)
  425. : m_b(truncation_test_(from, get_to_()))
  426. {}
  427. public:
  428. operator bool () const
  429. {
  430. return m_b;
  431. }
  432. private:
  433. static TO get_to_()
  434. {
  435. return TO();
  436. }
  437. private:
  438. const bool m_b;
  439. };
  440. #else /* ? 0 */
  441. #endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
  442. /** Indicates whether a given value can be cast to a given type without
  443. * truncation
  444. *
  445. * \ingroup group__library__conversion
  446. *
  447. * Example:
  448. <pre>
  449. truncation_cast&lt;unsigned>(-1); // Will return false, since negatives cannot fit in unsigned
  450. truncation_cast&lt;short>(30000); // Will return true, since 30000 will fit inside short (assuming short has >= 16-bits)
  451. </pre>
  452. *
  453. * \param from The value to be tested
  454. *
  455. * \retval false The value will experience truncation
  456. * \retval true The value will not be truncated
  457. */
  458. template< ss_typename_param_k TO
  459. , ss_typename_param_k FROM
  460. >
  461. #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
  462. inline bool truncation_test(FROM from, TO dummy = TO()) // The use of the dummy variable is to fix a bug with VC++ 5-7.0
  463. #else /* ? STLSOFT_DOCUMENTATION_SKIP_SECTION */
  464. inline bool truncation_test(FROM from)
  465. #endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
  466. {
  467. return truncation_test_(from, dummy);
  468. }
  469. #endif /* 0 */
  470. ////////////////////////////////////////////////////////////////////////////
  471. // Unit-testing
  472. #ifdef STLSOFT_UNITTEST
  473. # include "./unittest/truncation_test_unittest_.h"
  474. #endif /* STLSOFT_UNITTEST */
  475. /* ////////////////////////////////////////////////////////////////////// */
  476. #ifndef _STLSOFT_NO_NAMESPACE
  477. } // namespace stlsoft
  478. #endif /* _STLSOFT_NO_NAMESPACE */
  479. /* ////////////////////////////////////////////////////////////////////// */
  480. #endif /* !STLSOFT_INCL_STLSOFT_CONVERSION_HPP_TRUNCATION_TEST */
  481. /* ///////////////////////////// end of file //////////////////////////// */