boostorg / boostorg/boost

Add [[nodiscard]] attribute to the boost::span::subspan

Open
#910 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
8.6k
Forks
1.9k
Avg merge
39m
Merged PRs (30d)
2

Description

Could you add the `[[nodiscard]]` attribute to the `boost::span::subspan` function. I tend to forget to store the returned value:

```cpp
buffer_.subspan(bytesTransferred);
```
... instead of

```cpp
buffer_ = buffer_.subspan(bytesTransferred);
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.