C++ Native array ruminations

C++ native arrays. Exciting subject by no means.  Where the key and unique to C++ concept is: native array reference, which I have christened: NARF. A central concept to C++ native array handling.

// declare native array reference 
// to char array of size 255
using char_arr_255 = char (&)[255]

If you agree, you are perhaps in one of the two opposing fractions of the church of c++. Therefore, I can deduce, you believe in A or B:

  1. Native array references are implementation of the gods will
  2. Special care must be taken to exorcise, all native array references

Or as an sober alternative you refuse to take sides?  I have done and I am indeed using in my code, two different, but conceptually the same C++ utilities to easier use and manage native arrays.

First abstraction is dbj::ARH, or Array Helper abbreviated.  Post is here.

Second  utility I  am calling dbj::narf . Please proceed here.

when and if there is time  I plan to merge them into one.

c++ Play it only once Sam

Just how many times you have admitted to yourself it was rather foolish to think of globals in C++ as “a simple thing” 🙂 After all: What could possibly go wrong? If you know what I am talking about please proceed.

As it turns out many things can and will go wrong, with what you think of as C++ global variables and functions. I am sure every now and then, you are wondering why is this singleton not a singleton, why is this function called more than once,  and how it is, that nobody seems to care?

After many years of various coding idioms, that handle static linkage and global variables, and the famous “Singleton Pattern” implementations, may I be so bold to remind you: you do not have to dance around these issues any more.

It is 2018 after all. Continue reading “c++ Play it only once Sam”

c++ : human readable type names on both platforms

In case you like to experiment and learn modern C++, you will be needing some R&D little nuggets of your own.

For example. C++ is notorious for its powerful meta programming capabilities.  Thus it is very likely, in your C++ quest, you need to see the name of some type that is giving you headache.

Continue reading “c++ : human readable type names on both platforms”

My Quora nano moment of glory

“Mr Chueng” was kind enough to ask a question on Quora, which due to some email meandering of destiny has dropped into my inbox, too.

I think there might be some educational quality in this text, so here it is for my followers, here.  So what was the question and what is the answer.
Continue reading “My Quora nano moment of glory”