Are C ++ meta templates required for programmers?

In my experience, meta templates are really funny (when your compilers are compatible), and can give good performance improvements, and, fortunately, I am surrounded by experienced C ++ programmers who also metaphor meta templates, however sometimes a new developer comes in and cannot do the heads or tails of some of the meta-template tricks that we use (mainly material from Andrei Alenksandrescu) for several weeks until it is triggered accordingly.

So, I was wondering what is the situation for other C ++ programmers? If meta-template programming should be something like a C ++ programmer, do you need to “know” (with the exception of entry-level students, of course), or not?

Edit: Please note that my question is about production code, not small samples or prototypes

+3
source share
8 answers

, , , , . ( , , , : , , , ). - , , ++ .   , , ( n! , , ). , , , .

+7

, . , , ++ . , , . (, ++, )

+4

, - , - , N , ​​ , N, , . , , .

+3

? , . , , ++ DSP-, , , .

, ++, gcc 3.3ish +, , . , , , , , , STL . .

, ( < > ) , . , (container:: const_iterator iter =...) , .

+2

18 , - . , - , , , , (). , , , - , , YMMV.

+2

-, ( ) , , ( ) . , , .

, , . ( ), . , , , ( , ).

+1

, . , , STL Boost.

-, - . , . , .

+1

, ++. . .

, , , .

I encourage people to learn how to use some of the features of STL . I used this library in production code, and it saves time and simplifies things quite a bit. I also roll back when such a need arises.

I also heard well about the boost library .

If I need to write portable code, I will usually stick with patterns, because many compilers still do not support them properly. If you need a portable STL, then STLPort is the most portable.

-1
source

Source: https://habr.com/ru/post/1698239/


All Articles