Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #70322

Re: enum type in template declaration

From Paavo Helde <myfirstname@osa.pri.ee>
Newsgroups comp.lang.c++
Subject Re: enum type in template declaration
Date 2019-12-07 00:51 +0200
Organization A noiseless patient Spider
Message-ID <qsem1j$unb$1@dont-email.me> (permalink)
References (2 earlier) <qsdgou$paa$1@dont-email.me> <qsdib1$2j6$1@dont-email.me> <qsdv4a$fa2$1@dont-email.me> <qse6ma$1j7$1@dont-email.me> <qsei0f$7eo$1@dont-email.me>

Show all headers | View raw


On 6.12.2019 23:42, Soviet_Mario wrote:
>
> uhm ... the allocation of proper types is known, but at "CODE-TIME" some
> functions have duplexed code, and must know which part to use according
> to the actual type of the container caller.

Sorry, I cannot make heads or tails out of your babble, but as it seems 
you are fascinated by templates and not really comprehending them, here 
are some general remarks about them which might be helpful.

I know this can be confusing, but in C++ it is actually pretty simple: 
templates are a compile-time feature. If you need something to be solved 
by template mechanisms, it must be known at compile time. And vice 
versa, if something is only known only at run-time, you have to do it in 
an old-fashioned run-time way - an if, a switch, etc.

hth

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

enum type in template declaration Soviet_Mario <SovietMario@CCCP.MIR> - 2019-12-05 23:20 +0100
  Re: enum type in template declaration James Kuyper <jameskuyper@alumni.caltech.edu> - 2019-12-05 22:39 -0500
    Re: enum type in template declaration Soviet_Mario <SovietMario@CCCP.MIR> - 2019-12-06 13:15 +0100
      Re: enum type in template declaration Paavo Helde <myfirstname@osa.pri.ee> - 2019-12-06 14:42 +0200
        Re: enum type in template declaration Soviet_Mario <SovietMario@CCCP.MIR> - 2019-12-06 17:20 +0100
          Re: enum type in template declaration Paavo Helde <myfirstname@osa.pri.ee> - 2019-12-06 20:29 +0200
            Re: enum type in template declaration Soviet_Mario <SovietMario@CCCP.MIR> - 2019-12-06 22:42 +0100
              Re: enum type in template declaration Paavo Helde <myfirstname@osa.pri.ee> - 2019-12-07 00:51 +0200
                Re: enum type in template declaration Soviet_Mario <SovietMario@CCCP.MIR> - 2019-12-07 18:54 +0100
      Re: enum type in template declaration Öö Tiib <ootiib@hot.ee> - 2019-12-06 06:00 -0800
      Re: enum type in template declaration James Kuyper <jameskuyper@alumni.caltech.edu> - 2019-12-06 09:56 -0500
      Re: enum type in template declaration Manfred <noname@add.invalid> - 2019-12-06 15:56 +0100
  Re: enum type in template declaration Soviet_Mario <SovietMario@CCCP.MIR> - 2019-12-06 18:43 +0100
  Re: enum type in template declaration saturnman2008@gmail.com - 2019-12-07 01:53 -0800
    Re: enum type in template declaration Soviet_Mario <SovietMario@CCCP.MIR> - 2019-12-07 18:57 +0100

csiph-web