hachyderm.io is one of the many independent Mastodon servers you can use to participate in the fediverse.
Hachyderm is a safe space, LGBTQIA+ and BLM, primarily comprised of tech industry professionals world wide. Note that many non-user account types have restrictions - please see our About page.

Administered by:

Server stats:

8.9K
active users

When working with C++20 views, creating functions that encapsulate complex view compositions might be tempting.

However, that will very likely lead to unnecessary data copies. Instead, consider compositing views as inline constexpr variables.

Compiler Explorer link: compiler-explorer.com/z/vG4hhe

@simontoth Hi Simon, read your blog post recently. Do you mean functions that do one or some of the range operations, and return std::string's, or functions that return view adapters?

Šimon Tóth

@reed I meant wrapping this functionality into a trim function.