Skip to content

Commit

Permalink
Removed deprecated references to pack().
Browse files Browse the repository at this point in the history
  • Loading branch information
jfjlaros committed Oct 19, 2024
1 parent 5cf3c12 commit 0f40a16
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docs/plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ Example

Suppose we have set up two I/O interfaces named ``Serial`` and
``SerialUSB``, we serve the same methods on both interfaces by grouping
pointers to these interfaces with the ``pack()`` function as follows.
pointers to these interfaces with the ``makeTuple()`` function as follows.

.. code-block:: cpp
void loop() {
interface(
pack(&Serial, &SerialUSB),
makeTuple(&Serial, &SerialUSB),
inc, F("inc: Increment a value. @a: Value. @return: a + 1."));
}
Expand Down
8 changes: 4 additions & 4 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,15 @@ Exporting class methods
Class methods are different from ordinary functions in the sense that they
always operate on an object. This is why both a function pointer and a class
instance need to be provided to the ``interface()`` function. To facilitate
this, the ``pack()`` function can be used to combine a class instance and a
function pointer before passing them to ``interface()``.
this, the ``makeTuple()`` function can be used to combine a class instance and
a function pointer before passing them to ``interface()``.

For a class instance ``c`` of class ``C``, the class method ``f()``
can be packed as follows:

.. code-block:: cpp
pack(&c, &C::f)
makeTuple(&c, &C::f)
The result can be passed to ``interface()``.

Expand All @@ -157,7 +157,7 @@ Exporting this class method goes as follows:
void loop() {
interface(
Serial,
pack(&led, &LED::setBrightness),
makeTuple(&led, &LED::setBrightness),
"set_led: Set LED brightness. @brightness: Brightness.");
}
Expand Down

0 comments on commit 0f40a16

Please sign in to comment.