microsoft / microsoft/GSL

move ctor for strict_not_null should be removed

Open
#1,246 10 comments 0 reactions 1 assignee View on GitHub

@carsonRadtke is already working on this.

Since May 29, 2026.

Status: Blocked Status: Review Needed Type: Bug
Dominant language
C++
Stars
6.7k
Forks
772
Avg merge
4d 23h
Merged PRs (30d)
9

Description

In commit 9ff6e19ea9e2ecf48488c0865be85bb1ca183279 (issue #743) in 2018 strict_not_null was introduced. The interface was almost identical to the one of not_null, but the constructor is explicit.

Later in commit 6b23937bafca79ddd9b544e337aaba36a06ce339 in 2020 the move ctor for not_null was removed, but the move constructor for strict_not_null was not removed.

In my opinion the move constructor for strict_not_null should be removed as it was done with the move constructor for not_null. This aligns the interfaces of both classes to be the same. And it removes code that looks like it moves but instead copies, which is at least surprising.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.