lefticus / cpp_weekly

The official C++ Weekly Repository. Code samples and notes of future / past episodes will land here at various times. PR's will be accepted in some cases.
The Unlicense
709 stars 26 forks source link

Long form C++ Weekly episode on rewriting basic classes like Vector and String for no-heap embedded systems #218

Open NLS-BruceG opened 1 year ago

NLS-BruceG commented 1 year ago

Channel

Is this a "C++Weekly" or "The [Fill in the Blank] Programmer" episode request?

Topics

What topics are important to cover for this episode?

Length

Should this be bite-sized (5-10 minutes) or more long form (10-20 minutes)?

fcolecumberri commented 1 year ago

You don't need heap to use vector or string, those use the heap by default because the default allocator uses the heap. check this:

std::array<std::byte, 512> buffer;
std::pmr::monotonic_buffer_resource mbr{buffer.data(), buffer.size()};
std::pmr::polymorphic_allocator<int> pa{&mbr};
std::pmr::vector<int> args{pa};