summaryrefslogtreecommitdiffhomepage
path: root/docs/cptr_api.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/cptr_api.md')
-rw-r--r--docs/cptr_api.md12
1 files changed, 3 insertions, 9 deletions
diff --git a/docs/cptr_api.md b/docs/cptr_api.md
index 4ef2e443..3583bc62 100644
--- a/docs/cptr_api.md
+++ b/docs/cptr_api.md
@@ -6,9 +6,11 @@ The pointed-to elements are automatically destructed and deleted when the contai
See the c++ classes [std::shared_ptr](https://en.cppreference.com/w/cpp/memory/shared_ptr) for a functional reference.
-## Declaration
+## Header file and declaration
```c
+#include <stc/cptr.h>
+
using_cptr(X, Value);
using_cptr(X, Value, valueCompare);
using_cptr(X, Value, valueCompare, valueDel);
@@ -21,14 +23,6 @@ The macro `using_cptr()` must be instantiated in the global scope. `X` is a type
affect the names of all cptr types and methods. E.g. declaring `using_cptr(v4, Vec4);`,
`X` should be replaced by `v4` in all of the following documentation.
-## Header file
-
-All cptr and csptr definitions and prototypes are available by including a single header file.
-
-```c
-#include <stc/cptr.h>
-```
-
## Methods
The *del()* and *compare()* methods are defined based on the arguments passed to the **using**-macro. For **csptr**, use *csptr_X_clone(p)* when sharing ownership of the pointed-to object. See examples below.