Şöyle yaparız
struct Things
{
Things(const char* msg1, const char* msg2) : one(msg1), two(msg2) {}
Unmovable one;
Unmovable two;
};
int main()
{
std::optional<Things>{std::in_place, "jadda", "neida"};
}
struct Things
{
Things(const char* msg1, const char* msg2) : one(msg1), two(msg2) {}
Unmovable one;
Unmovable two;
};
int main()
{
std::optional<Things>{std::in_place, "jadda", "neida"};
}
void convertBigToLittleEndianIfNecessary(uint32_t& code) {
if constexpr (std::endian::native == std::endian::little) {
code = ((code & 0xFF000000) >> 24) |
((code & 0x00FF0000) >> 8) |
((code & 0x0000FF00) >> 8) |
((code & 0x000000FF) >> 24);
}
}
std::bit_width finds minimum bits required to represent an integral number x as 1+floor(log(x))