Advertisement
playerr17

Untitled

Oct 10th, 2023
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.72 KB | None | 0 0
  1. - requires std::is_base_of_v<Deleter, DerDel> UniquePtr(UniquePtr<T, DerDel>&& other) noexcept
  2. - : data_(other.data_.GetFirst(), std::move(other.data_.GetSecond())) {
  3. - other.data_.GetFirst() = nullptr;
  4. - }
  5. -
  6. - template <typename F>
  7. - requires std::is_base_of_v<T, F> UniquePtr(UniquePtr<F>&& other) noexcept
  8. - : data_(other.data_.GetFirst(), std::move(other.data_.GetSecond())) {
  9. + requires std::is_base_of_v<Deleter, DerDel> UniquePtr(UniquePtr<T, DerDel>&& other)
  10. + noexcept : data_(other.data_.GetFirst(), std::move(other.data_.GetSecond())) {
  11. + other.data_.GetFirst() = nullptr;
  12. + }
  13. +
  14. + template <typename F>
  15. + requires std::is_base_of_v<T, F> UniquePtr(UniquePtr<F>&& other)
  16. + noexcept : data_(other.data_.GetFirst(), std::move(other.data_.GetSecond())) {
  17. other.data_.GetFirst() = nullptr;
  18. }
  19.  
  20. template <typename F, typename DerDel>
  21. - requires std::is_base_of_v<T, F> && std::is_base_of_v<Deleter, DerDel>
  22. - UniquePtr(UniquePtr<F, DerDel>&& other) noexcept
  23. - : data_(other.data_.GetFirst(), std::move(other.data_.GetSecond())) {
  24. + requires std::is_base_of_v<T, F> && std::is_base_of_v<Deleter, DerDel> UniquePtr(
  25. + UniquePtr<F, DerDel>&& other)
  26. + noexcept : data_(other.data_.GetFirst(), std::move(other.data_.GetSecond())) {
  27. other.data_.GetFirst() = nullptr;
  28. }
  29.  
  30. @@ -174,8 +174,8 @@
  31. }
  32.  
  33. template <typename F, typename DerDel>
  34. - requires std::is_base_of_v<T, F> && std::is_base_of_v<Deleter, DerDel>
  35. - UniquePtr& operator=(UniquePtr<F, DerDel>&& other) {
  36. + requires std::is_base_of_v<T, F> && std::is_base_of_v<Deleter, DerDel> UniquePtr& operator=(
  37. + UniquePtr<F, DerDel>&& other) {
  38. if (data_.GetFirst() == other.data_.GetFirst()) {
  39. return *this;
  40. }
  41. @@ -275,21 +275,21 @@
  42. }
  43.  
  44. template <typename DerDel>
  45. - requires std::is_base_of_v<Deleter, DerDel> UniquePtr(UniquePtr<T, DerDel>&& other) noexcept
  46. - : data_(other.data_.GetFirst(), std::move(other.data_.GetSecond())) {
  47. - other.data_.GetFirst() = nullptr;
  48. - }
  49. -
  50. - template <typename F>
  51. - requires std::is_base_of_v<T, F> UniquePtr(UniquePtr<F>&& other) noexcept
  52. - : data_(other.data_.GetFirst(), std::move(other.data_.GetSecond())) {
  53. + requires std::is_base_of_v<Deleter, DerDel> UniquePtr(UniquePtr<T, DerDel>&& other)
  54. + noexcept : data_(other.data_.GetFirst(), std::move(other.data_.GetSecond())) {
  55. + other.data_.GetFirst() = nullptr;
  56. + }
  57. +
  58. + template <typename F>
  59. + requires std::is_base_of_v<T, F> UniquePtr(UniquePtr<F>&& other)
  60. + noexcept : data_(other.data_.GetFirst(), std::move(other.data_.GetSecond())) {
  61. other.data_.GetFirst() = nullptr;
  62. }
  63.  
  64. template <typename F, typename DerDel>
  65. - requires std::is_base_of_v<T, F> && std::is_base_of_v<Deleter, DerDel>
  66. - UniquePtr(UniquePtr<F, DerDel>&& other) noexcept
  67. - : data_(other.data_.GetFirst(), std::move(other.data_.GetSecond())) {
  68. + requires std::is_base_of_v<T, F> && std::is_base_of_v<Deleter, DerDel> UniquePtr(
  69. + UniquePtr<F, DerDel>&& other)
  70. + noexcept : data_(other.data_.GetFirst(), std::move(other.data_.GetSecond())) {
  71. other.data_.GetFirst() = nullptr;
  72. }
  73.  
  74. @@ -340,8 +340,8 @@
  75. }
  76.  
  77. template <typename F, typename DerDel>
  78. - requires std::is_base_of_v<T, F> && std::is_base_of_v<Deleter, DerDel>
  79. - UniquePtr& operator=(UniquePtr<F, DerDel>&& other) {
  80. + requires std::is_base_of_v<T, F> && std::is_base_of_v<Deleter, DerDel> UniquePtr& operator=(
  81. + UniquePtr<F, DerDel>&& other) {
  82. if (data_.GetFirst() == other.data_.GetFirst()) {
  83. return *this;
  84. }
  85.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement