Re: Passing empty "tag" structs

2018-09-07 Thread David Brown
On 07/09/2018 10:10, Jonathan Wakely wrote: On Fri, 7 Sep 2018 at 08:06, David Brown wrote: In C++ programming, it is sometimes helpful to have empty structs acting as tags. An example is "struct nothrow_t {}". When parameters of these types - such as "nothrow", are passed to functions the

Re: Passing empty "tag" structs

2018-09-07 Thread Jonathan Wakely
On Fri, 7 Sep 2018 at 08:06, David Brown wrote: > > In C++ programming, it is sometimes helpful to have empty structs acting > as tags. An example is "struct nothrow_t {}". > > When parameters of these types - such as "nothrow", are passed to > functions the compiler passes them as a value 0. Sin

Passing empty "tag" structs

2018-09-07 Thread David Brown
In C++ programming, it is sometimes helpful to have empty structs acting as tags. An example is "struct nothrow_t {}". When parameters of these types - such as "nothrow", are passed to functions the compiler passes them as a value 0. Since the type cannot hold any kind of value, surely it co