Replies: 3 comments 2 replies
-
|
#828 has some background on the use of shared_ptr within the context. For the thread-local context implementation using the SLL approach, there’s room for optimization - contributions are welcome. The current design might look a bit odd, but it was intentional to keep the context immutable as per the specs, meaning that any addition creates a new context containing all previous elements. |
Beta Was this translation helpful? Give feedback.
-
|
Does it really make sense that a |
Beta Was this translation helpful? Give feedback.
-
|
And what is the goal of all these From my PoV it would be better to allow exceptions. This opens the possibility to throw at least an invalid_arg in the constructor. This would be good, because currently there is no argument checking, e.g. whether a |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi guys,
I'm very new here. I checked the API a bit (just an overview), and here the first question comes into my mind. How did/do you decide which data structure to use for the given problem to solve?
I saw that there are structures/objects used, which produce superfluous overhead. I want to have a lightweight reporting interface to send some telemetry data, putting as little overhead as possible to the current application.
Let me give examples. In Context a handwritten SLL (single linked list) is used, which uses shared_ptrs for its elements. Additionally adding an element appends on the end of the list, requiring to iterate through all elements first.
Interfaces return shared pointers, even if they are not required. Like in most examples a shared pointer is created and than moved into another object. A unique pointer would be more efficient here.
Beta Was this translation helpful? Give feedback.
All reactions