pool_construct_simple.ipp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // Copyright (C) 2000 Stephen Cleary
  2. //
  3. // Distributed under the Boost Software License, Version 1.0. (See
  4. // accompanying file LICENSE_1_0.txt or copy at
  5. // http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. // See http://www.boost.org for updates, documentation, and revision history.
  8. // This file was AUTOMATICALLY GENERATED from "stdin"
  9. // Do NOT include directly!
  10. // Do NOT edit!
  11. template <typename T0>
  12. element_type * construct(const T0 & a0)
  13. {
  14. element_type * const ret = (malloc)();
  15. if (ret == 0)
  16. return ret;
  17. try { new (ret) element_type(a0); }
  18. catch (...) { (free)(ret); throw; }
  19. return ret;
  20. }
  21. template <typename T0, typename T1>
  22. element_type * construct(const T0 & a0, const T1 & a1)
  23. {
  24. element_type * const ret = (malloc)();
  25. if (ret == 0)
  26. return ret;
  27. try { new (ret) element_type(a0, a1); }
  28. catch (...) { (free)(ret); throw; }
  29. return ret;
  30. }
  31. template <typename T0, typename T1, typename T2>
  32. element_type * construct(const T0 & a0, const T1 & a1, const T2 & a2)
  33. {
  34. element_type * const ret = (malloc)();
  35. if (ret == 0)
  36. return ret;
  37. try { new (ret) element_type(a0, a1, a2); }
  38. catch (...) { (free)(ret); throw; }
  39. return ret;
  40. }