mirror of
https://github.com/Light-City/CPlusPlusThings.git
synced 2026-10-31 12:25:17 +08:00
- const README: rewrite the space-saving claim per issue #5 follow-ups (constant-expression const vs #define immediates; which const qualify as constant expressions) - const README: fix the class-section diagnosis per issue #338 (overload resolution picks the const overload; the restriction only surfaces once that overload is removed) - sizeof README: virtual-inheritance result is compiler-dependent (GCC merges vbptr+vfptr -> 16, MSVC keeps them separate -> 32) #246 - static README: new section on internal linkage / access restriction with anonymous-namespace comparison #142 - 10-day practice: full problem list table + fixed day links #136 - new design_pattern/singleton/singleton_default.hpp: reusable thread-safe CRTP singleton template, compile+concurrency tested #303
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
> 本文档由 [C++那些事网站](https://light-city.github.io/stories_things/cpp-things/bit/) 同步生成,网站版本含多语言与更新排版。
|
||||
|
||||
# C++ 位域
|
||||
|
||||
## 关于作者:
|
||||
|
||||
个人公众号:
|
||||
|
||||

|
||||

|
||||
|
||||
## Bit field 是什么?
|
||||
|
||||
@@ -108,7 +112,7 @@ struct stuff
|
||||
|
||||
这里 stuff.field1 与 stuff.field2 之间有一个 2 Bits 的空隙,stuff.field3 则存储在下一个 unsigned int 中,该结构现在大小为 3 * 32 = 96 Bits。
|
||||
|
||||
学习代码见:[bit.cpp](bit.cpp)
|
||||
学习代码见:[bit.cpp](https://github.com/Light-City/CPlusPlusThings/tree/master/basic_content/bit/bit.cpp)
|
||||
|
||||
## 位域的初始化和位的重映射
|
||||
|
||||
|
||||
Reference in New Issue
Block a user