Skip to content

Fix wrong statement in code sample in std::is_trivally_copyable_v#75

Merged
Charliechen114514 merged 1 commit into
Awesome-Embedded-Learning-Studio:mainfrom
YukunJ:fix-wrong-code-sample
Jun 22, 2026
Merged

Fix wrong statement in code sample in std::is_trivally_copyable_v#75
Charliechen114514 merged 1 commit into
Awesome-Embedded-Learning-Studio:mainfrom
YukunJ:fix-wrong-code-sample

Conversation

@YukunJ

@YukunJ YukunJ commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Brief: wrong statement in the code sample in std::is_trivally_copyable_v section.

// T 不是 trivial(用户定义了构造),通常也不是 trivially_copyable

This is not a true statement.

I was originally inspired by

可以安全地用 memcpy 按字节拷贝(拷完目标有同样的对象表示,且能正常析构)

and thought T would be trivially_copyable and confused by seeing the tutorial stating 通常也不是 trivially_copyable.

And I ran the local experiment and looked up standard docs for more clarification on this.

QA:
See godbolt sample: https://godbolt.org/z/dT9c8dWWj

@Charliechen114514

@YukunJ YukunJ force-pushed the fix-wrong-code-sample branch from 1114a40 to 3f933a9 Compare June 22, 2026 03:10
@Charliechen114514

Copy link
Copy Markdown
Member

收到,这里的确是一处笔误,感谢您的批评指正!

@Charliechen114514 Charliechen114514 merged commit f71b02b into Awesome-Embedded-Learning-Studio:main Jun 22, 2026
4 checks passed
@YukunJ YukunJ deleted the fix-wrong-code-sample branch June 22, 2026 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants