More asciidoctor changes

Reinstate the none/blank trick, but remove the blank line after it in local_shared_ptr.adoc that causes the problem. Also use that trick in place of the nested DLs which don't work with Asciidoctor 2
This commit is contained in:
Glen Fernandes
2019-03-24 23:41:04 -04:00
parent adcab0e313
commit d10299159a
9 changed files with 528 additions and 179 deletions
+44 -16
View File
@@ -105,7 +105,9 @@ Type:: Provides the type of the stored pointer.
```
explicit shared_array(T* p = 0);
```
[horizontal]
[none]
* {blank}
+
Effects:: Constructs a `shared_array`, storing a copy of `p`, which must be a
pointer to an array that was allocated via a C++ `new[]` expression or be 0.
Afterwards, the use count is 1 (even if `p == 0`; see `~shared_array`).
@@ -115,11 +117,13 @@ Throws:: `std::bad_alloc`. If an exception is thrown, `delete[] p` is called.
```
template<class D> shared_array(T* p, D d);
```
[horizontal]
[none]
* {blank}
+
Effects:: Constructs a `shared_array`, storing a copy of `p` and of `d`.
Afterwards, the use count is 1. When the the time comes to delete the array
pointed to by `p`, the object `d` is used in the statement `d(p)`.
Requires[horizontal]
Requires::
* `T` is a complete type.
* The copy constructor and destructor of `D` must not throw.
* Invoking the object `d` with parameter `p` must not throw.
@@ -128,7 +132,9 @@ Throws:: `std::bad_alloc`. If an exception is thrown, `d(p)` is called.
```
shared_array(const shared_array& v) noexcept;
```
[horizontal]
[none]
* {blank}
+
Effects:: Constructs a `shared_array`, as if by storing a copy of the pointer
stored in `v`. Afterwards, the use count for all copies is 1 more than the
initial use count.
@@ -139,7 +145,9 @@ Requires:: `T` is a complete type.
```
~shared_array() noexcept;
```
[horizontal]
[none]
* {blank}
+
Effects:: Decrements the use count. Then, if the use count is 0, deletes the
array pointed to by the stored pointer. Note that `delete[]` on a pointer with
a value of 0 is harmless.
@@ -149,7 +157,9 @@ a value of 0 is harmless.
```
shared_array& operator=(const shared_array& v) noexcept;
```
[horizontal]
[none]
* {blank}
+
Effects:: Constructs a new `shared_array` as described above, then replaces
this `shared_array` with the new one, destroying the replaced object.
Requires:: `T` is a complete type.
@@ -160,7 +170,9 @@ Returns:: `*this`.
```
void reset(T* p = 0);
```
[horizontal]
[none]
* {blank}
+
Effects:: Constructs a new `shared_array` as described above, then replaces
this `shared_array` with the new one, destroying the replaced object.
Requires:: `T` is a complete type.
@@ -169,10 +181,12 @@ Throws:: `std::bad_alloc`. If an exception is thrown, `delete[] p` is called.
```
template<class D> void reset(T* p, D d);
```
[horizontal]
[none]
* {blank}
+
Effects:: Constructs a new `shared_array` as described above, then replaces
this `shared_array` with the new one, destroying the replaced object.
Requires[horizontal]
Requires::
* `T` is a complete type.
* The copy constructor of `D` must not throw.
Throws:: `std::bad_alloc`. If an exception is thrown, `d(p)` is called.
@@ -193,7 +207,9 @@ Requires:: `T` is a complete type.
```
T* get() const noexcept;
```
[horizontal]
[none]
* {blank}
+
Returns:: The stored pointer.
### unique
@@ -201,7 +217,9 @@ Returns:: The stored pointer.
```
bool unique() const noexcept;
```
[horizontal]
[none]
* {blank}
+
Returns:: `true` if no other `shared_array` is sharing ownership of the
stored pointer, `false` otherwise.
@@ -210,7 +228,9 @@ stored pointer, `false` otherwise.
```
long use_count() const noexcept;
```
[horizontal]
[none]
* {blank}
+
Returns:: The number of `shared_array` objects sharing ownership of the
stored pointer.
@@ -219,7 +239,9 @@ stored pointer.
```
explicit operator bool() const noexcept;
```
[horizontal]
[none]
* {blank}
+
Returns:: `get() != 0`.
Requires:: `T` is a complete type.
@@ -228,7 +250,9 @@ Requires:: `T` is a complete type.
```
void swap(shared_array<T>& b) noexcept;
```
[horizontal]
[none]
* {blank}
+
Effects:: Exchanges the contents of the two smart pointers.
## Free Functions
@@ -247,7 +271,9 @@ template<class T> bool
template<class T> bool
operator<(const shared_array<T>& a, const shared_array<T>& b) noexcept;
```
[horizontal]
[none]
* {blank}
+
Returns:: The result of comparing the stored pointers of the two smart
pointers.
@@ -265,6 +291,8 @@ mandates that relational operations on pointers are unspecified (5.9
template<class T>
void swap(shared_array<T>& a, shared_array<T>& b) noexcept;
```
[horizontal]
[none]
* {blank}
+
Returns:: `a.swap(b)`.
Requires:: `T` is a complete type.