Boost logo

Boost :

From: Vinnie Falco (vinnie.falco_at_[hidden])
Date: 2020-03-06 18:11:59


On Fri, Mar 6, 2020 at 10:03 AM Viktor Sehr via Boost
<boost_at_[hidden]> wrote:
> I really would appreciate if the library could be used as header only

I'll take it one step farther. The library should:

* Default to compilation into a static or dynamic lib, e.g. libboost_deflate.o
* Compile header-only, by defining BOOST_DEFLATE_HEADER_ONLY
* Require only C++11
* Compile without the rest of Boost (i.e. no dependencies), by defining
  BOOST_DEFLATE_STANDALONE. In this configuration, C++17 or later
  will be required. The boost:: namespace will remain.
* Configurably support C++ equivalents of Boost types such as
string_view and optional.

All of my new libraries follow this pattern. To assist in building
such libraries, I have created a repository "library_template" which
has a trivial function, that serves as a template which anyone can
clone to form the starting point of a Boost library meeting these
requirements. It has Bjam and Boost-compatible CMake support, tests,
examples, coverage, sanitizers, CI (travis, appveyor, azure), and
working badges:

<https://github.com/vinniefalco/library_template>

> some sort of abbreviation of these convenience functions:
> auto compress(const std::vector<uint8_t>& uncompressed) ->
> std::vector<uint8_t>;
> auto decompress(const std::vector<uint8_t>& compressed) ->
> std::optional<std::vector<uint8_t>>;

Yes thank you, this is precisely what the OP was asking. I agree
having convenience functions is great, something like this too:

    std::string compress( string_view s );

Regards


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk