Skip to content

Providing explicit documentation for throwing an exception when no bu… #21

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

Merged
merged 5 commits into from
Aug 3, 2017

Conversation

cjdb
Copy link

@cjdb cjdb commented Aug 2, 2017

…ffer exists.

Copy link
Contributor

@AerialMantis AerialMantis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, some minor comments on the wording.


```cpp
bool accessor<T, Dim, Mode, Target, Placeholder>::has_buffer() const noexcept
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to define the member function here, just provide the declaration and then describe what they should do.


void handler::require(buffer<T, dim> b,
accessor<T, dim, mode, target, access::placeholder::true_t> a)
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to define the member function here, just provide the declaration and then describe what they should do.


### `accessor`s without buffers
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

accessors without buffers -> Placeholder accessor without a buffer.


### `accessor`s without buffers

If a placeholder accessor is not tied to a buffer within a command group, then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a placeholder accessor -> If a placeholder accessor which was not constructed with a buffer.

Copy link
Author

@cjdb cjdb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AerialMantis @Ruyk, for your review

an exception is thrown.
If a placeholder accessor which was not constructed with a buffer is not tied
to a buffer within a command group, then an exception is thrown. An accessor
can be checked for a buffer using `has_buffer()`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the existence of an associated buffer

```
|Member function |Description |
|-----------------|---------------------------------------------------------|
|bool has_buffer()|Returns true if the accessor is associated with a buffer,|
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool has_buffer() const to prevent side effects

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops!

@cjdb
Copy link
Author

cjdb commented Aug 3, 2017

@Ruyk for your review

@Ruyk Ruyk merged commit 117519e into codeplaysoftware:issue-11 Aug 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants