functions_cons_copy_dest.qbk 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. [/
  2. Copyright (c) 2008-2009 Joachim Faulhaber
  3. Distributed under the Boost Software License, Version 1.0.
  4. (See accompanying file LICENSE_1_0.txt or copy at
  5. http://www.boost.org/LICENSE_1_0.txt)
  6. ]
  7. [/ //= Construct, copy, destruct ===================================================================]
  8. [section Construct, copy, destruct]
  9. [table
  10. [[['*Construct, copy, destruct*]] [__ch_itvs__][__ch_itv_sets__][__ch_itv_maps__][__ch_ele_sets__][__ch_ele_maps__] ]
  11. [[`T::T()`] [1] [1] [1] [1] [1] ]
  12. [[`T::T(const P&)`] [A] [__eiS] [__bpM] [1] [1] ]
  13. [[`T& T::operator=(const P&)`] [A] [__S] [__M] [1] [1] ]
  14. [[`void T::swap(T&)`] [ ] [1] [1] [1] [1] ]
  15. ]
  16. All *icl* types are ['*regular types*]. They are ['*default constructible*],
  17. ['*copy constructible*] and ['*assignable*]. On icl Sets and Maps a `swap`
  18. function is available, that allows for *constant time* swapping of
  19. container contents.
  20. The /regular and swappable part/ of the basic functions and their complexities
  21. are described in the tables below.
  22. [table
  23. [[['*Regular and swap*]] [__ch_itvs__][__ch_itv_sets__][__ch_itv_maps__][__ch_ele_sets__][__ch_ele_maps__] ]
  24. [[`T::T()`] [__O1__] [__O1__] [__O1__][__O1__] [__O1__] ]
  25. [[`T::T(const T&)`] [__O1__] [__On__] [__On__][__On__] [__On__] ]
  26. [[`T& T::operator=(const T&)`] [__O1__] [__On__] [__On__][__On__] [__On__] ]
  27. [[`void T::swap(T&)`] [ ] [__O1__] [__O1__][__O1__] [__O1__] ]
  28. ]
  29. where /n/ `= iterative_size(x)`.
  30. [table
  31. [[['*Construct, copy, destruct*]] [Description] ]
  32. [[`T::T()`] [Object of type T is default constructed.] ]
  33. [[`T::T(const T& src)`] [Object of type T is copy constructed from object `src`. ] ]
  34. [[`T& T::operator=(const T& src)`][Assigns the contents of src to `*this` object. Returns a reference to the assigned object.] ]
  35. [[`void T::swap(T& src)`] [Swaps the content containers `*this` and `src` in constant time. ] ]
  36. ]
  37. In addition we have overloads of constructors and assignment operators
  38. for icl container types.
  39. ``
  40. // overload tables for constructors
  41. T::T(const P& src)
  42. element containers: interval containers:
  43. T \ P | e b s m T \ P | e i b p S M
  44. ------+-------- ------+------------
  45. s | s s S | S S S
  46. m | m m M | M M M
  47. ``
  48. For an object `dst` of type `T` and an argument `src` of type `P` let
  49. ``
  50. n = iterative_size(dst);
  51. m = iterative_size(src);
  52. ``
  53. in the following tables.
  54. [table Time Complexity for overloaded constructors on element containers
  55. [[`T(const P& src)`][__ch_dom_t__][__ch_dom_mp_t__][__ch_itv_sets__][__ch_itv_maps__]]
  56. [[__icl_set__] [__Olgn__] [] [__Om__] [] ]
  57. [[__icl_map__] [] [__Olgn__] [] [__Om__] ]
  58. ]
  59. Time complexity characteristics of inplace insertion for interval containers
  60. is given by this table.
  61. [table Time Complexity for overloaded constructors on interval containers
  62. [[`T(const P& src)`] [__ch_dom_t__][__ch_itv_t__][__ch_dom_mp_t__][__ch_itv_mp_t__][__ch_itv_sets__][__ch_itv_maps__]]
  63. [[interval_sets] [__O1__] [__O1__][] [] [__Om__] [] ]
  64. [[interval_maps] [] [] [__O1__][__O1__][] [__Om__] ]
  65. ]
  66. ``
  67. // overload tables for assignment
  68. T& operator = (const P& src)
  69. interval containers:
  70. T \ P | S M
  71. ------+----
  72. S | S
  73. M | M
  74. ``
  75. The assignment `T& operator = (const P& src)` is overloaded within interval containers.
  76. For all type combinations we have ['*linear time complexity*]
  77. in the maximum of the `iterative_size` of `dst` and `src`.
  78. ['*Back to section . . .*]
  79. [table
  80. []
  81. [[[link function_synopsis_table ['*Function Synopsis*]]]]
  82. [[[link boost_icl.interface ['*Interface*]] ]]
  83. ]
  84. [endsect][/ Construct, copy, destruct]