Why does the standard C++ library use all lower case?

Main reason : To keep compatibility with the existing code, since they have done it with C also. Also have a look at these C++ Coding standards, which presents some generic reasoning regarding the importance of convention. These links discusses about the naming conventions of C/C++ Standard Library. Naming Convention for C API C/C++ Library … Read more

C++ vector of arrays

Unfortunately, std::array does not have an initializer list constructor. Indeed, it has no user-defined constructor whatsoever — this “feature” is a leftover from C++03 where omitting all user-defined constructors was the only way to enable the C-style brace initialization. It is IMHO a defect in the current standard. So why doesn’t built-in brace initialization work … Read more

Can I use a Tag Helper in a custom Tag Helper that returns html?

No you cannot. TagHelpers are a Razor parse time feature. One alternative is creating a TagHelper and manually invoking its ProcessAsync/Process method. Aka: var anchorTagHelper = new AnchorTagHelper { Action = “Home”, }; var anchorOutput = new TagHelperOutput(“a”, new TagHelperAttributeList(), (useCachedResult, encoder) => new HtmlString()); var anchorContext = new TagHelperContext( new TagHelperAttributeList(new[] { new TagHelperAttribute(“asp-action”, … Read more

Implementing Move Constructor by Calling Move Assignment Operator

[…] will the compiler be able to optimize away the extra initializations? In almost all cases: yes. Should I always write my move constructors by calling the move assignment operator? Yes, just implement it via move assignment operator, except in the cases where you measured that it leads to suboptimal performance. Today’s optimizer do an … Read more

DataTestMethod vs TestMethod

ShreyasRmsft commented the following on GitHub: Hi @cactuaroid DataTestMethod is not needed. Go ahead and use TestMethod with DataRows to data drive your tests. For any more doubts follow the official docs at https://github.com/microsoft/testfx-docs https://github.com/microsoft/testfx/issues/614 https://github.com/microsoft/testfx-docs/issues/64 So, according to Microsoft, it is preferred to use TestMethod over DataTestMethod.

#if DEBUG vs if (env.IsDevelopment())

Preprocessor directives are conditionally compiled… Which means that something like this: #if DEBUG //Do something #endif Will only be compiled and checked if the DEBUG symbol is defined (it is defined when the build is set to DEBUG). Additionally, in the IDE the code between the preprocessor symbols will appear greyed out. This code: if … Read more