google / google/emboss

The C++ compiler error when using `Write()` (and related methods) on a read-only view type is confusing

Open
#100 0 comments 0 reactions 0 assignees View on GitHub
cleanup
Dominant language
Python
Stars
92
Forks
30
PR merge metrics
No merged PRs in 30d

Description

The compiler complains about passing the wrong type to `memcpy()` (passing `const char *` as the first argument) deep inside Emboss internal template code, which is not clear to an end user.

Using `std::enable_if<... backing storage is writeable>` on `Write()` would help. Ideally, we could coerce the C++ compiler to emit a message saying to use the `...Writer` type alias instead of `...View`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.