Doesn't get much glibber than that!
Why intentionally design a worse alternative to std::weak_ptr which has been around since C++11??
One reason why this design can still be beneficial when using the standard std::shared_ptr in its implementation, is when you do not want to manage the pointee object by a std::shared_ptr (which is a requirement if you want to use std::weak_ptr). E.g., if you want to ensure that multiple objects of that type are laid out next to each other in memory, instead of scattered around the heap.
Another goal of the post is to show this idea, namely to use a shared_ptr<T*> (instead of shared_ptr<T>), which is kind of non-standard, but can be (as I hope I convinced you) sometimes useful.
template<typename S>
auto make_appender(S&& suffix)
{
return [perf_fwd_suffix = std::tuple{std::forward<S>(suffix)}](std::vector<int>&& items)
{
return append(std::move(items), std::get<0>(perf_fwd_suffix));
};
}
see:
https://godbolt.org/z/M9P4MK4a8We build a software product that enables parties that manage privacy-sensitive data to collaborate and jointly extract insights without having to mutually share the underlying data. Our product is based on secure multiparty computation (MPC), a mature academic subfield of cryptography; MPC is among the most promising privacy enhancing technologies (PETs).
Roseman Labs was founded in March 2020; meanwhile we have a growing customer base and our team consists of 11 people (+ 1 pet).
We are looking for talent to help us further develop the core of this product (C++20 & Computer Science / Math knowledge), as well as intuitive web-based GUIs (JavaScript, Svelte, etc.) tailored to different user roles (privacy officer, data scientist, business owner, etc.).
Core:
- C++20 development on Linux (gcc, clang, concepts, coroutines, etc.)
- asynchronous networking & disk I/O, cooperative multitasking, multi-core
- high performance networking (zero-copy, RSS, ...)
- cryptographic protocols, finite-ring / finite-field arithmetic
- performance benchmarking & optimization
GUI layer:
- Javascript/Typescript
- Svelte
- CSS
- UX
- interaction design
https://www.rosemanlabs.com jobs@rosemanlabs.com
There are alternative ways to utilize a machine with multiple cores, e.g. by running one thread per CPU core, and not sharing state between those threads; in each such thread you then have single-thread "semantics".