Is std::byte well defined?

Essentially there is special wording all around the c++17 draft standard that gives std::byte the same properties with regard to aliasing as char and unsigned char. To give you an example, the the C++17 standard, [basic.lval] p8 states: If a program attempts to access the stored value of an object through a glvalue of other … Read more

Does a pointer to std::byte have the same aliasing relaxations as char*?

From the current Standard draft ([basic.types.general]/2): For any object (other than a potentially-overlapping subobject) of trivially copyable type T, whether or not the object holds a valid value of type T, the underlying bytes ([intro.memory]) making up the object can be copied into an array of char, unsigned char, or std​::​byte ([cstddef.syn]). If the content … Read more

How similar are Boost.Filesystem and the C++ standard filesystem library?

There are a number of differences. Some were, I believe, Boost changes that were never propagated. For example, there is no path.filename_is_dot() query (as discussed below, it would be less useful in std::filesystem anyway). There was also a good bit of late-breaking news on this front: Support for non-POSIX-like filesystems: Specify whether a string is … Read more

Why doesn’t an if constexpr make this core constant expression error disappear?

The standard doesn’t say much about the discarded statement of an if constexpr. There are essentially two statements in [stmt.if] about these: In an enclosing template discarded statements are not instantiated. Names referenced from a discarded statement are not required ODR to be defined. Neither of these applies to your use: the compilers are correct … Read more

Get types of C++ function parameters

This syntax is slightly different. First, because types are easier to work with than packs, a type that holds a pack. The using type=types; just saves me work in the code that generates a types: template<class…>struct types{using type=types;}; Here is the workhorse. It takes a signature, and produces a types<?…> bundle containing the arguments for … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)