Skip to content
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

[custom] Don't use memcpy/memcpy/memset for non-POD types #4272

Closed
gnawme opened this issue Jul 14, 2020 · 1 comment
Closed

[custom] Don't use memcpy/memcpy/memset for non-POD types #4272

gnawme opened this issue Jul 14, 2020 · 1 comment
Labels
status: triage Labels incomplete

Comments

@gnawme
Copy link
Contributor

gnawme commented Jul 14, 2020

Per C++ Coding Standards Item 96

memcpy and memcmp violate the type system. Using memcpy to copy objects is like making money using a photocopier. Using memcmp to compare objects is like comparing leopards by counting their spots. The tools and methods might appear to do the job, but they are too coarse to do it acceptably.

memset is also considered harmful.

#3368

@gnawme gnawme added the status: triage Labels incomplete label Jul 14, 2020
@kunaltyagi
Copy link
Member

Duplicate of #3368

@kunaltyagi kunaltyagi marked this as a duplicate of #3368 Jul 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: triage Labels incomplete
Projects
None yet
Development

No branches or pull requests

2 participants