1

Topic: Templates With ++ - again on sale!

https://www.ozon.ru/context/detail/id/145861864/ the Given issuing describes new possibilities of standards of a C ++ 11, the C ++ 14 and a C ++ 17 and shows the last achievements in the field of C templates ++ for creation of a wide spectrum of applications. Authors explicitly explain all new possibilities of language which refine templates or interaction with them, considering such subjects, as  the templates, the generalized lambda-expression, an output of arguments of class templates, a construction if compile time, transmittable links and the user literals. They also deeply investigate into fundamental concepts of language (such as categories of values) and completely envelop standard properties of types. The book begins with the thorough textbook describing the main concepts and possibilities connected to them of a programming language. The remaining part of the book serves as the universal reference manual paying attention as particulars of language, and to the encoding techniques, the advanced technologies and difficult idioms of programming of templates of a C ++. The set of examples of initial texts is illustrated by the abstract concepts and the best practical approaches for obtaining from C templates ++ the maximum favor. ++ exact understanding  the templates, allowing to avoid widespread traps

2

Re: Templates With ++ - again on sale!

Hello, LaptevVV, you wrote: the People from C templates ++ jump aside as from fire, and ability not to apply templates is considered a sign of high qualification. Using templates, name "not able to write simply". But in purely academic purposes it is possible and to be kidding, it would be desirable there more to experiment, instead of Talmuds to read.

3

Re: Templates With ++ - again on sale!

Hello, LaptevVV, you wrote: LVV> https://www.ozon.ru/context/detail/id/145861864/ it certainly it is healthy - to write Templates. But here to read and debug their rare "pleasure". As a rule excessive  generate excessive  in  with which it is necessary to struggle heroically. Would describe as correctly is better to organize the big projects. How to struggle with complexity accumulation. Or how to work from video, a sound, zip-archives, bitmap images,  as texts and databases on a C ++. There are such books?

4

Re: Templates With ++ - again on sale!

Hello, smeeld, you wrote: S> the People from C templates ++ jump aside as from fire, and ability not to apply templates is considered a sign of high qualification. Using templates, name "not able to write simply". But in purely academic purposes it is possible and to be kidding, it would be desirable there more to experiment, instead of Talmuds to read. If the person jumps aside from std:: shared_ptr, at it low qualification. And after all std:: shared_ptr is a template. So it is not clear, about what you write.

5

Re: Templates With ++ - again on sale!

Hello, smeeld, you wrote: S> Hello, LaptevVV, you wrote: S> the People from C templates ++ jump aside as from fire, and ability not to apply templates is considered a sign of high qualification. And it is necessary to jump aside on the contrary from such people because the knowledge of language on which you write, in all its aspects and is considered a sign of high qualification Using templates, name "not able to write simply". And writing simply as a result carry out a heap of the code in  which there is never used or on the contrary drive the code which can be eliminated at a compilation stage. Or other trouble, instead of one template class or function forms family. Competent metaprogramming allows to generate the code not only for different types, but also for different models of behavior. And as to reading of the sample code I will answer with the known citation: "Boris, only do not employ on this business a dale... ." ()

6

Re: Templates With ++ - again on sale!

Hello, kov_serg, you wrote: _> it certainly it is healthy - to write Templates. But here to read and debug their rare "pleasure". And it is possible for steam of words about problems of debugging of templates?

7

Re: Templates With ++ - again on sale!

Hello, YuriV, you wrote: YV> as a result carry out a heap of the code in  which there is never used or on the contrary drive the code which can be eliminated at a compilation stage. You joke? Look at the sizes of binary files which  at a C ++. You are surprised how many the code there is not used. YV> competent metaprogramming allows to generate the code not only for different types, but also for different models of behavior. The difference between the theory and practice that in the theory, between the theory and practice there is no difference, and in practice it is. Look back around, all modern software solutions  pores "are not ideal" and do not differ an effective utilization of resources. Today the main thing speed of obtaining of profit, and it is rarely connected to metaprogramming and behavior of models. Here   control  programmers than the code.

8

Re: Templates With ++ - again on sale!

Hello, B0FEE664, you wrote: BFE> If the person jumps aside from std:: shared_ptr, at it low qualification. And after all std:: shared_ptr is a template. BFE> so it is not clear, about what you write. std:: shared_ptr, of course, the template, only is a more library template. Above meant not stupidly usage something from STL or boost, and writing of the code, using parametrization of types (the, not library).

9

Re: Templates With ++ - again on sale!

Hello, smeeld, you wrote: S> the People... We are disaccustomed to speak for all

10

Re: Templates With ++ - again on sale!

Hello, kov_serg, you wrote: _> you joke? Look at the sizes of binary files which  at a C ++. You are surprised how many the code there is not used. Just about, so let's add to it still kiloton. _> a difference between the theory and practice that in the theory, between the theory and practice there is no difference, and in practice it is. _> Look back around, all modern software solutions  pores "are not ideal" and do not differ an effective utilization of resources. _> today the main thing speed of obtaining of profit, and it is rarely connected to metaprogramming and behavior of models. _> here   control  programmers than the code. So the sample code also is written for , to be exact coders which not in a state to optimize the task decision. In my segment (automation of productions, development CAD/CAM/CAE for specific tasks, resource management etc.) Flexibility and reliability of the decision on the one hand and ease of use,  with another is appreciated. And it is modularly-component model which without code generation in a kompajl-time very quickly turns to a slow pumpkin if seaming  in system and a system behavior choice entirely to lay on . As to "not " it is dangerous not itself , and the today's tendency offered  from , whether at which  grows hardly is factorial. It is necessary to invent it to write text editors on  and still to fasten to it the browser, and look at answers on SO, the person asks as it to write any the elementary  on a knee, and to it there and then offer  megalibrary or  a bed-sheet from a shit and sticks which the author did not find time at all . As to profit the profit for the present is measured in our niche by quality of a software, and to a lesser degree in the speed of development.

11

Re: Templates With ++ - again on sale!

Hello, smeeld, you wrote: S>... And ability not to apply templates is considered a sign of high qualification. In a fantastic way as! Now inability to apply can be produced for ability not to apply. The good religion was invented by Hindus (

12

Re: Templates With ++ - again on sale!

Hello, ArtDenis, you wrote: AD> And it is possible for steam of words about problems of debugging of templates? https://en.wikibooks.org/wiki/C%2B%2B_P … ugging_TMP still  can deliver https://stackoverflow.com/questions/813 … er-8131212 http://processors.wiki.ti.com/index.php … ion_Issues

13

Re: Templates With ++ - again on sale!

Hello, YuriV, you wrote: _>> you joke? Look at the sizes of binary files which  at a C ++. You are surprised how many the code there is not used. YV> Just about so let's add to it still kiloton. You did not understand. The C ++ with templates leads more superfluous binary files practically in 100 % of cases. YV> so the sample code also is written for , to be exact coders which not in a state to optimize the task decision. In my segment (automation of productions, development CAD/CAM/CAE for specific tasks, resource management etc.) Flexibility and reliability of the decision on the one hand and ease of use,  with another is appreciated. And it is modularly-component model which without code generation in a kompajl-time very quickly turns to a slow pumpkin if seaming  in system and a system behavior choice entirely to lay on . For such programmers is  languages python, javascript, lisp and at all  remembered vba. And for productions languages of type ST in difference from a C ++ fierce real-time are used a miracle. YV> As to "not " it is dangerous not itself , and the today's tendency offered  from , whether at which  grows hardly is factorial. It is necessary to invent it to write text editors on  and still to fasten to it the browser, and look at answers on SO, the person asks as it to write any the elementary  on a knee, and to it there and then offer  megalibrary or  a bed-sheet from a shit and sticks which the author did not find time at all . Here I with you completely agree. Efficiency of the modern software very much afflicts. A software build also the "modern" materials (of a shit and sticks) and the same "modern" tools. Since  capacities grew repeatedly and there are copecks on them it is accepted not to turn  until then while it is comprehensible moves on  to gland. YV> as to profit the profit for the present is measured in our niche by quality of a software, and to a lesser degree in the speed of development. There is no such value as quality of a software. Even units of measure such are not present. And here without financing  you will write a software centuries.

14

Re: Templates With ++ - again on sale!

Hello, smeeld, you wrote: S> std:: shared_ptr, of course, the template, only is a more library template. Above meant not stupidly usage something from STL or boost, and writing of the code, using parametrization of types (the, not library). And what such in normal parametrization of types? It like as initial, put by design of language mission of templates before "opened" metaprogramming on them.

15

Re: Templates With ++ - again on sale!

Hello, ArtDenis, you wrote: AD> And it is possible for steam of words about problems of debugging of templates? , suitable humour! I initially learned and  templates, very much it was pleasant, but then tried  and rushed! In a current type  templates are the most classical  . Except simple and obvious cases of their application more anywhere there is no sense to use. All remaining metaprogramming, simulation of a reflection and attempt in DSL on pluses is a cancer of a brain beginning from compile time finishing debugging.  the maximum for 1 day is written, the code beautiful and pure as tear works eternally, optimization/debugging is ideal, compilation is instant. And and possibilities  are borderless - in difference from templates you not  how to deliver the compiler a cancer that it turned out though something  similar to the demanded decision, and work immediately over the task.

16

Re: Templates With ++ - again on sale!

Hello, rg45, you wrote: S>>... And ability not to apply templates is considered a sign of high qualification. R> it is class as! Now inability to apply can be produced for ability not to apply. The good religion was invented by Hindus (you Understand... Here personally to me improbably to study laziness technology about which I precisely know that I will throw out it. Not to do this unnecessary zigzag easier.

17

Re: Templates With ++ - again on sale!

Hello, anonymouse2, you wrote: A> And what such in normal parametrization of types? It like as initial, put by design of language mission of templates before "opened" metaprogramming on them. It is cast the Author: chaotic-kotik Date: 08.07 13:04

18

Re: Templates With ++ - again on sale!

Hello, kov_serg, you wrote: _> you did not understand. The C ++ with templates leads more superfluous binary files practically in 100 % of cases. I.e. you consider, what the code written with usage of templates leads  to the size  a file? It is a parcel of rubbish. _> for such programmers is  languages python, javascript, lisp and at all  remembered vba. No,  languages it is brakes. In our internal  it is used , but only for breadboarding. To the customer if he wishes, we too give this language for the elementary scripts, but itself  it is units and components on With ++ with metaprogramming on templates which are described on our internal meta language (a title watermark) which is analog Nitra and allows to create the DSL for different needs, is able  connected DSL/C/C ++ and to transform the code from DSL representations in With ++. It is built in in  through a plug-in, works after a preprocessing stage, but before parsing. _> and for productions languages of type ST in difference from a C ++ fierce real-time are used a miracle. We do not program controlers, our level for CAM systems it CNC-programming (G-CODE). And a source language of the description of a system architecture it STEP (ISO-10303) and language EXPRESS (ISO-10303-11). _> Here I with you completely agree. Efficiency of the modern software very much afflicts. A software build also the "modern" materials (of a shit and sticks) and the same "modern" tools. Since  capacities grew repeatedly and there are copecks on them it is accepted not to turn  until then while it is comprehensible moves on  to gland. But it seems that after all  and spectra to a direction "productivity through a cache and speculative execution" comes . At first OS ceased to use page storage, than reduced security in exchange for productivity. Now during time speculative execution resolutions on access to storage areas are not checked. YV>> as to profit the profit for the present is measured in our niche by quality of a software, and to a lesser degree in the speed of development. _> there is no such value as quality of a software. Even units of measure such are not present. And here without financing  you will write a software centuries. The qualitative software is a software which corresponds  the customer. If the customer wrote in  that for it  frequency of falling of a software of times in a week the software satisfying to this requirement will be qualitative from the point of view of this requirement. And about financing, it is not necessary worries, you simply do not represent what money customers of an average hand pay for specialized, exclusive systems even, but for it they demand the qualitative software corresponding /// to standards, there do not roll nonsense of experts in marketing. About centuries to you is more visible, but we create the breadboard models and products for time comprehensible to the customer which also is stipulated in . By the way for this purpose also formed our internal , languages and tools and an other infrastructure.

19

Re: Templates With ++ - again on sale!

Hello, alpha21264, you wrote: A> you Understand... Here personally to me improbably to study laziness technology about which I precisely know that I will throw out it. A> not to do this unnecessary zigzag easier. Do not study, anybody imposes nothing to you.

20

Re: Templates With ++ - again on sale!

Hello, kov_serg, you wrote: AD>> And it is possible for steam of words about problems of debugging of templates? _> https://en.wikibooks.org/wiki/C%2B%2B_P … ugging_TMP I.e. under debugging reading of errors at compilation of templates meant?

21

Re: Templates With ++ - again on sale!

Hello, AeroSun, you wrote: AS> I initially learned and  templates, very much it was pleasant, but then tried  and rushed! AS> in a current type  templates are the most classical  . Except simple and obvious cases of their application more anywhere there is no sense to use. std:: variant, std:: function - to what cases you carry? And their implementation? Or for example std:: iterator_traits? Or it is all too you suggest to generate? AS> attempt in DSL on pluses not simply DSL, and EDSL, with all that it implies. AS> Kodogeneratsija is written a maximum for 1 day, Depends from. Any and for 5 minutes, other can much longer - depending on  the input description, and integration with a remaining C ++ the code. That about what you tell - most likely any one specific case got to you personally AS> the code beautiful and pure as tear, optimization/debugging is ideal Only now this code in two different languages, is more exact even on three - for normally there is still a third source language for the generator. In the total, in case of a problem - it is necessary to skip between all three. And considering that there everywhere splice of lines - normal typification as a rule misses also errors  only at final compilation (if at all are caught by it) - thus the information poor, is normal only from target language without full callstack'. AS> And and possibilities  are borderless - in difference from templates you not  how to deliver the compiler a cancer that it turned out though something  similar to the demanded decision, and work immediately over the task. If not to go into extremes, are normally used both that and another, and and also preprocessor macroes for everywhere there are unique advantages, and unique lacks.

22

Re: Templates With ++ - again on sale!

Hello, Evgeny. Panasyuk, you wrote: EP> std:: variant, std:: function - to what cases you carry? To cases of struggle against windmills. It should be the built in types. AS>> attempt in DSL on pluses EP> it is not simple DSL, and EDSL, with all that it implies. Yes, yes, inconveniently and poorly. Except as proof of concept it is more on what it is not necessary. AS>> Kodogeneratsija is written a maximum for 1 day, EP> Depends from. Any and for 5 minutes, other can much longer - depending on  the input description, and integration with a remaining C ++ the code. EP> about what you tell that - most likely any one specific case got to you personally At any deal to achieve similar result by means of metaprogramming occupies at the best 10 times time. Only here  also will work further ideally, and in a case metaprogramming with it it is necessary to struggle all time. Half a year with  is enough not to work, and then a step aside - and we start to scroll a broad gull of errors: meter, meter, kilometer, meter, meter.... AS>> the code beautiful and pure as tear, optimization/debugging is ideal EP> Only now this code in two different languages, is more exact even on three - for normally there is still a third source language for the generator. EP> in the total, in case of a problem - it is necessary to skip between all three. And considering that there everywhere splice of lines - normal typification as a rule misses also errors  only at final compilation (if at all are caught by it) - thus the information poor, is normal only from target language without full callstack'. Yes though in ten places if it is easier, faster and more conveniently. Only here it is necessary to skip just on templates in a heap of places. And in case of the generator in 99 % of cases it is required to check up only an input. About a problem of debugging and typification it you are visible only with  (type python-generators) faced. At more serious generators even there is the optimal choice of type/algorithm. Fastening the same clang we get access to AST pluses in a convenient natural type. Further at us the compiler extension actually turns out: we can from pluses  other languages (SQL for example), from other languages - pluses, from pluses to transform to pluses, from other languages to transform to other languages, to palm off the most optimal types, to select the most optimal algorithms and ., etc. And all it at a compilation stage. And everywhere there will be a pure and clear syntax without gram . And all will be very simple for debugging it, even not simply, and it is elementary. And speed of compilation will be reactive. And IDE with helps will work ideally. Etc., etc. Metaprogramming in a current type in pluses - is simple not that level. EP> If not to go into extremes are normally used both that and another and and also preprocessor macroes for everywhere there are unique advantages, and unique lacks. Macroes??? The last time their usage saw in 2005-2006. Further in all companies where worked they are forbidden (except the elementary cases) by internal agreements. Appearance of any macro in the code is almost an automatic dip code review. To prove necessity of its usage - practically monumental task. And it is correct - macroes, as well as the metapornography is an axiom : the heap of implicit/unevident events/conversions happens out of attention focus, dependence not only on a local context, syntactic garbage not having any relation to a solved problematics.

23

Re: Templates With ++ - again on sale!

Hello, AeroSun, you wrote: AS> Yes though in ten places if it is easier, faster and more conveniently. AS> only here it is necessary to skip just on templates in a heap of places. And in case of the generator in 99 % of cases it is required to check up only an input. AS> about a problem of debugging and typification it you are visible only with  (type python-generators) faced. At more serious generators even there is the optimal choice of type/algorithm. AS> fastening the same clang we get access to AST pluses in a convenient natural type. Further at us the compiler extension actually turns out: we can from pluses  other languages (SQL for example), from other languages - pluses, from pluses to transform to pluses, from other languages to transform to other languages, to palm off the most optimal types, to select the most optimal algorithms and ., etc. And all it at a compilation stage. And everywhere there will be a pure and clear syntax without gram . And all will be very simple for debugging it, even not simply, and it is elementary. And speed of compilation will be reactive. And IDE with helps will work ideally. Etc., etc. Uh you. I want. There is what that specific ready application-oriented  which all it do? To take, fasten and forward.  titles of serious generators ?

24

Re: Templates With ++ - again on sale!

Hello, AeroSun, you wrote: AS>... At more serious generators even there is the optimal choice of type/algorithm. AS> fastening the same clang we get access to AST pluses in a convenient natural type. Further at us the compiler extension actually turns out:... And all will be very simple for debugging it, even not simply, And it is possible to look at this miracle? To us are necessary  Bills.

25

Re: Templates With ++ - again on sale!

2 vopl and YuriV: ? Did not see ready generators of the code? Yes it is stupid that at all on hearing: gsoap, protobuf, thrif... For generation something  from source codes - such nobody gives, for at everyone the know-how, but a principle stupidly in the first lines of Google. Here : https://www.slideshare.net/corehard_by/clang-55533071