Can’t auto-generate IDENTITY with AddRange in Entity Framework

What was causing the problem? Enumerables! Take a look at the EDIT section in my question for the solution. EDIT: posting the updated code here as answer. The problem was in the way I used enumerables. Bottom line is you should never trust lazy loading when you need consistent results right away. public class Request … Read more

target_compile_options() for only C++ files?

Solution You can do this with generator expressions: target_compile_options(MyLib PUBLIC $<$<COMPILE_LANGUAGE:CXX>:-std=c++14>) Alternative But the more platform independent way of doing it in this particular case would be to use target_compile_features(). I’m not sure which compiler feature you’re using, so the following is only an example: target_compile_features(MyLib PUBLIC cxx_explicit_conversions)

Sending data with PACKET_MMAP and PACKET_TX_RING is slower than “normal” (without)

Many interfaces to the linux kernel are not well documented. Or even if they seem well documented, they can be pretty complex and that can make it hard to understanding what the functional or, often even harder, nonfunctional properties of the interface are. For this reason, my advice to anyone wanting a solid understanding of … Read more

How do I check if an std::variant can hold a certain type

Edit: I actually dig your std::disjunction idea, and it absolutely works. You just have to extract the type list using template specialization. My entire old-school recursive mess becomes simply: template<typename T, typename VARIANT_T> struct isVariantMember; template<typename T, typename… ALL_T> struct isVariantMember<T, std::variant<ALL_T…>> : public std::disjunction<std::is_same<T, ALL_T>…> {}; Original answer: Here’s a simple template that accomplishes … Read more

`Type.GetProperties` property order

The order simply isn’t guaranteed; whatever happens…. Happens. Obvious cases where it could change: anything that implements ICustomTypeDescriptor anything with a TypeDescriptionProvider But a more subtle case: partial classes. If a class is split over multiple files, the order of their usage is not defined at all. See Is the “textual order” across partial classes … Read more