PrevUpHome

Rationale

text, rope Are Implicitly Convertible from char const *.

I find that the syntactic overhead of bringing UDLs into scope and then using them to be too high in some cases. Aggregate initialization including string-like objects is one of those:

Table 1.9. Explicit vs. Implicit Conversion from `char const *`

Explicit

Implicit

using namespace boost::text::literals;

std::array<boost::text::text, 3> = {{ "foo"_t, "bar"_t, "baz"_t }};

std::array<boost::text::text, 3> = {{ "foo", "bar", "baz" }};


I find the implicit-conversion code much more natural.

Unicode Algorithm Tailoring

The behavior of some of the Unicode algorithms is intended to be tailorable. Boost.Text provides customization of some of its Unicode algorithm implementations for this purpose. Some possible tailorings are not available.

Boost.Text Does Not Use allocators

Allocators are too low gain for the cost they impose. How many std::basic_string template instantiations in the code bases of the world involve a non-default allocator? I would be surprised if it was as high as 1%. Allocators may once have served an important function, but in modern C++ are a perfect example of not sticking to "Don't pay for what you don't use."

As a concrete example, consider std::vector. This is a type whose sole purpose is to manage the allocations and reallocations of a heap-allocated array for you. Its interface allows me, via its allocator template parameter, to change its behavior to be a stack-allocated array of fixed size, but with a std::vector interface. This has a large impact on the properties of the type, the noexcept-ness of and time complexity of swap() to name just one. I don't consider this to be a feature of the std::vector design, but a bug.


PrevUpHome