boostorg / boostorg/hof

Consider using {} instead of () when constructing objects in samples

Open
#90 0 comments 0 reactions 0 assignees View on GitHub
code enhancement
Dominant language
C++
Stars
509
Forks
94
PR merge metrics
No merged PRs in 30d

Description

For example, in this:

```
struct id
{
template
T operator()(T x) const
{
return x;
}
};

auto int_result = boost::fit::result(id());
static_assert(std::is_same::value, "Not the same type");
```

Consider changing the second-to-last line to:

`auto int_result = boost::fit::result(id{});`

This makes it obvious that the use of "id" is a construction, not a call.

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.