Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Articles by Dieter Lücking
C++ Iterators: Best practice to represent end of range - Last or Beyond-last?
I am writing a library which deals a lot with sub-sequences of ordered containers. So for example I have a container (1,2,3,4,5,6) and a user wants to access (3,4,5). I am providing the subsequence by a pair of iterators, pointing to its first and last element respectively, i.e. 3 and 5.
Private static member in base class
#include <iostream> #include <string> class Base { static std::string s; }; template<typename T> class Derived : Base { public: Derived() { std::cout << s << std::endl; } }; std::string Base::s = "some_text"; int main() { Derived<int> obj; } This programs compiles and runs normally. static variable s is private in base class that is inherited privately. How is Derived class accessing it? If Derived class is not template, compiler complains about accessing private variable.
Can a generic lambda have no arguments?
First of all, I know I could use templated class/functor, but that is not what I want. Here is the lambda: auto lambda = [] (auto var) { decltype(var) x; //do stuff with x but nothing with var }; The problem is I receive the warning C4100(unreferenced formal parameter). I also know I could use tricks such as disabling the warning and enabling it again after the lambda or using macros such as UNREFERENCED_PARAMETER, but that is cheating. Is there any way I could accomplish that?
Is floating point precision mutable or invariant?
I keep getting mixed answers of whether floating point numbers (a.k.a. , or ) have one and only one value of precision, or have a precision value which can vary. One topic called float vs. double precision seems to imply that floating point precision is an absolute. However, another topic called Difference between float and double says, I don't like to refer to approximations like the above if I'm working with sensitive code that can break easily when my values are not exact.
Show More
loading
Actions
Is this you?
As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.Get in touch with Dieter
Contact Dieter, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack