26

Re: Analog scoped enum to a C ++ 11

Hello, kov_serg, you wrote: _> Really only at you one such problems arose? Which "such"? _> What for it were necessary for you enum, moreover and isolated. For convenience and reliability. A common example: there is a server (in my case - the kernel driver), is the client. By operation with the server the codes of operations, modes, etc. which are the most natural for setting renumerators are used, these codes are often transferred simply in parameters of requests, out of structures. If to declare their normal enum' - it is necessary to attach to them unique prefixes, and it looks clumsily in language,  using qualifiers of areas of visibility.

27

Re: Analog scoped enum to a C ++ 11

Hello, Evgenie Muzychenko, you wrote: I eat> For convenience and reliability. A common example: there is a server (in my case - the kernel driver), is the client. By operation with the server the codes of operations, modes, etc. which are the most natural for setting renumerators are used, these codes are often transferred simply in parameters of requests, out of structures. If to declare their normal enum' - it is necessary to attach to them unique prefixes, and it looks clumsily in language,  using qualifiers of areas of visibility. But the S-approach from  does not depend.

28

Re: Analog scoped enum to a C ++ 11

Hello, kov_serg, you wrote: _> Here for example function sqrt waits the positive values, asin value from a range [-1. 1]. So it is quite possible to use types with restrictions. Moreover sometimes it would be desirable check on overfillings for example at integer numbers. Well and how it will look in the code? Here at me I am written sqrt (b*b-4*a*c) so I understand that a, b, c - normal numbers, accordingly and D = b*b-4*a*c too. And during what moment the type exchanges on "nonnegative float"?

29

Re: Analog scoped enum to a C ++ 11

Hello, Evgenie Muzychenko, you wrote: I eat> For convenience and reliability. A common example: there is a server (in my case - the kernel driver), is the client. By operation with the server the codes of operations, modes, etc. which are the most natural for setting renumerators are used, these codes are often transferred simply in parameters of requests, out of structures. If to declare their normal enum' - it is necessary to attach to them unique prefixes, and it looks clumsily in language,  using qualifiers of areas of visibility. I in such place would prefer clumsy reliability to refined tricks

30

Re: Analog scoped enum to a C ++ 11

Hello, Erop, you wrote: E> Hello, kov_serg, you wrote: _>> Here for example function sqrt waits the positive values, asin value from a range [-1. 1]. So it is quite possible to use types with restrictions. Moreover sometimes it would be desirable check on overfillings for example at integer numbers. E> well and how it will look in the code? E> here at me it is written sqrt (b*b-4*a*c) E> I so I understand that a, b, c - normal numbers, accordingly and D = b*b-4*a*c too. E> And during what moment the type exchanges on "nonnegative float"? During what moment the type in a template changes on the necessary? As required. assume (b, a, c, D is real); assume (D> =0); D: = b*b-4*a*c; return sqrt (D);

31

Re: Analog scoped enum to a C ++ 11

Hello, Evgenie Muzychenko, you wrote: _>> What for it were necessary for you enum, moreover and isolated. I eat> For convenience and reliability. A common example: there is a server (in my case - the kernel driver), is the client. By operation with the server the codes of operations, modes, etc. which are the most natural for setting renumerators are used, these codes are often transferred simply in parameters of requests, out of structures. If to declare their normal enum' - it is necessary to attach to them unique prefixes, and it looks clumsily in language,  using qualifiers of areas of visibility. I suspect that for convenience to you besides the codes of operations also the exchange protocol is necessary (the specification of packets) what operation parameters to transfer and answers . Here is easier code generators to make from DSL what both client and server code and bake . And let inside looks somehow.

32

Re: Analog scoped enum to a C ++ 11

Hello, kov_serg, you wrote: _> During what moment the type in a template changes on the necessary? As required. _> _> assume (b, a, c, D is real); _> assume (D> =0); _> D: = b*b-4*a*c; _> return sqrt (D); _> What for here any types? Types - same about static checks, instead of about RT assert (D> = 0) it is enough, and INSIDE sqrt

33

Re: Analog scoped enum to a C ++ 11

Hello, Erop, you wrote: E> What for here any types? Types - same about static checks, instead of about RT E> assert (D> = 0) it is enough, and INSIDE sqrt It not static checks. This specification of types on the code. As pattern matching. Depending on  different algorithms of calculation of value are possible. For example maple> assume (a <0);> dsolve (diff (y (x), x$2) =a*y (x), y (x)); y (x) = - _C1 sin (sqrt (-a ~) x) + _C2 cos (sqrt (-a ~) x)> assume (a> 0);> dsolve (diff (y (x), x$2) =a*y (x), y (x)); y (x) = _C1 exp (-sqrt (a ~ (x) + _C2 exp (sqrt (a ~ (x) And in the declaration sqrt can be specification that the type has restriction. The compiler can generate on a miscellaneous the code depending on specifications by which you can  do to it different implementations. A good example language halide where it is possible to specify how it is necessary to organize the execution schedule. By the same principle if you separate algorithm from the schedule, data types, data view and boundary conditions you receive levels of freedom are new to synthesis and executable code optimization. Which you never receive in a C ++ with its metaprogramming and templates.

34

Re: Analog scoped enum to a C ++ 11

Hello, kov_serg, you wrote: _> the Good example language halide where it is possible to specify how it is necessary to organize the execution schedule. _> by the same principle if you separate algorithm from the schedule, data types, data view and boundary conditions you receive levels of freedom are new to synthesis and executable code optimization. Which you never receive in a C ++ with its metaprogramming and templates. And at what here / ++ and their type system?

35

Re: Analog scoped enum to a C ++ 11

Hello, Erop, you wrote: E> And at what here / ++ and their type system? Thus in a C ++ to you there will be no that that you want in any type. It simply tool with the lacks. Either will be measured with them or use other tool. By means of a C ++ it is possible to complicate as is wished any task and then to struggle with problems which created.

36

Re: Analog scoped enum to a C ++ 11

Hello, Erop, you wrote: E> I in such place would prefer clumsy reliability to refined tricks Therefore to me and ideas with  in "a live" class are not pleasant.

37

Re: Analog scoped enum to a C ++ 11

Hello, kov_serg, you wrote: _> Here is easier code generators to make from DSL what both client and server code and bake . It becomes easier it when functions and data types it is typed on  tens.

38

Re: Analog scoped enum to a C ++ 11

Hello, Evgenie Muzychenko, you wrote: _>> Here is easier code generators to make from DSL what both client and server code and bake . I eat> it becomes easier it when functions and data types it is typed on  tens. Normally their hundreds and moreover they evolve from the version to the version.

39

Re: Analog scoped enum to a C ++ 11

Hello, kov_serg, you wrote: I eat>> when functions and data types it is typed on  tens. _> it is normal their hundreds "Normally" are you on what sampling?