codeplaysoftware / standards-proposals

Repository for publicly sharing proposals in various standards groups
Apache License 2.0
27 stars 17 forks source link

Default constructed accessors #89

Closed ProGTX closed 4 years ago

ProGTX commented 5 years ago

This relates to https://github.com/codeplaysoftware/standards-proposals/pull/18.

It introduces a default constructed placeholder accessor, similar to that patch, called a null accessor here. Instead of proposing a require(buf, acc), the buffer can be "bound" to an accessor by creating a new placeholder accessor that is already bound to a buffer. It can then be used as a normal placeholder accessor. If it's not bound, it can still be passed into a kernel, but should not be dereferenced inside the kernel.

A new free function make_placeholder_accessor accessor is also proposed.

ProGTX commented 4 years ago

This has been replaced by https://github.com/codeplaysoftware/standards-proposals/pull/124, which defines an accessor to be a Container, and then you can have "empty" accessors if acc.empty() == true.

keryell commented 4 years ago

This has been replaced by #124, which defines an accessor to be a Container, and then you can have "empty" accessors if acc.empty() == true.

Nice side effect of this container (point-of-) view...