New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[atomics.syn] doesn't depict memory_order_meow
#5385
Comments
Would that include deduction guides? We notably do not depict the declarations of deduction guides in the header synopses, they are conventionally declared together with the corresponding class template synopsis. (Which fact I personally have always found odd.) Should our conventions ensure that all namespace-scope declarations (except those which exist only for exposition) appear in header synopses? |
For modules, deduction guides are "invisible" (in the sense that we don't/can't directly export them, they're just associated with the primary template in some magical way). There may still be reasons for an editorial preference to put them in the header synopsis, but seeing what's in the |
Similar example (I can file a separate issue if the editors want): [ranges.syn] depicts only: // 26.5.4, sub-ranges
enum class subrange_kind : bool { unsized, sized };
template<input_or_output_iterator I, sentinel_for<I> S = I, subrange_kind K = see below >
requires (K == subrange_kind::sized || !sized_sentinel_for<S, I>)
class subrange;
template<class I, class S, subrange_kind K>
inline constexpr bool enable_borrowed_range<subrange<I, S, K>> = true; However, [range.subrange.general] defines more: namespace std::ranges {
// [...exposition only machinery...]
template<input_or_output_iterator I, sentinel_for<I> S = I, subrange_kind K =
sized_sentinel_for<S, I> ? subrange_kind::sized : subrange_kind::unsized>
requires (K == subrange_kind::sized || !sized_sentinel_for<S, I>)
class subrange : public view_interface<subrange<I, S, K>> {
// [...class definition...]
};
// [...deduction guides...]
template<size_t N, class I, class S, subrange_kind K>
requires ((N == 0 && copyable<I>) || N == 1)
constexpr auto get(const subrange<I, S, K>& r);
template<size_t N, class I, class S, subrange_kind K>
requires (N < 2)
constexpr auto get(subrange<I, S, K>&& r);
}
namespace std {
using ranges::get;
} I expected to see |
On Tue, 5 Apr 2022, 01:21 Casey wrote:
Would that include deduction guides? We notably do not depict the
declarations of deduction guides in the header synopses, they are
conventionally declared together with the corresponding class template
synopsis. (Which fact I personally have always found odd.)
The rationale there is that they're kinda like constructors, telling you what arguments are valid for constructing the type. We don't list constructors in the header synopsis (we couldn't even if we wanted to, of course, they can't be declared before the full class body is shown).
I think grouping then with constructors, i.e. with the class synopsis, is more useful than:
… Should our conventions ensure that all namespace-scope declarations
(except those which exist only for exposition) appear in header synopses?
|
The current operative rule is that deduction guides go with the class synopsis; any other namespace-scope declaration (which need not be a definition) is shown in the header synopsis. |
As of N4910, [atomics.order] defines:
However, these
inline constexpr
variables withinnamespace std
don't appear within [atomics.syn] which says only:I am unsure of the editorial conventions here, but as an implementer of the proposed Standard Library Modules, I find it most helpful when the header synopsis lists all top-level inhabitants of
namespace std
.The text was updated successfully, but these errors were encountered: