4 ms·
> the length function for c++ strings does return a constant object - No, I mean, a standalone function with no parameters can only be functional if it always
by jb1991 4y ago
> the length function for c++ strings does return a constant object -
No, I mean, a standalone function with no parameters can only be functional if it always returns the same value, which is effectively no different than declaring a constant. The function always returns the same value all time (which wouldn't be so useful).
I think you are trying to find C++ examples to match the broader implications of functional programming (which is what I'm talking about), which will be difficult.
As far as whether "functional programming will catch on", I don't think it will for C++ so much, but it certainly has been very successful for many other languages. I earn my living writing only functional code, but most of the time it is not in C++.