public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* too few template-parameter-lists
@ 2005-07-20 14:51 Michael Gatford
  2005-07-20 15:36 ` corey taylor
  2005-07-20 15:49 ` Eljay Love-Jensen
  0 siblings, 2 replies; 4+ messages in thread
From: Michael Gatford @ 2005-07-20 14:51 UTC (permalink / raw)
  To: gcc help

Hi,

The following compiles ok with egcs-2.91.66 on Solaris (5.6/7/8), with 
gcc2.95.3 on Redhat 8.0 and VS6 on Windows, but not with GCC 4.0.0 on 
Fedora Core 4.

The following is defined in a header file

// Structure mapping a command name to a function to be
// called, within a class-based context.
template<class X> struct commandTags {
    char* name;
    void (X::*func)();
};

 which is included by a program in which it is used like, e.g.

commandTags<FmPage> mapTags<FmPage>::mustags[] = {
  { "page.include",        &FmPage::includeFile },
  { "page.version",        &FmPage::printVersion },
  { "page.script_name",    &FmPage::printScriptname },
  { "page.gif_dir",        &FmPage::printGifdir },

   ........
   ........
}

This generates the error "too few template-parameter-lists".

Mike

-- 
___________________________________________________ 
Michael Gatford
Senior Technical Consultant
___________________________________________________ 
APR Smartlogik Limited.
Rustat House - Clifton Road - Cambridge - CB1 7EJ
phone +44 (0)1223 27 1025
fax   +44 (0)1223 27 1010
map: http://www.aprsmartlogik.com/contact/CambridgeMap.pdf

mailto:michael.gatford@aprsmartlogik.com 
http://www.aprsmartlogik.com/ 

***********************************************************************
This e-mail may contain proprietary and confidential 
information and is intended for the recipient(s) only. 
If an addressing or transmission error has misdirected this 
e-mail, please notify the systems administrator by forwarding 
this e-mail to mailto:postmaster@aprsmartlogik.com. 
If you are not the intended recipient(s) disclosure, distribution, 
copying or printing of this e-mail is strictly prohibited.
***********************************************************************

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: too few template-parameter-lists
  2005-07-20 14:51 too few template-parameter-lists Michael Gatford
@ 2005-07-20 15:36 ` corey taylor
  2005-07-20 15:49 ` Eljay Love-Jensen
  1 sibling, 0 replies; 4+ messages in thread
From: corey taylor @ 2005-07-20 15:36 UTC (permalink / raw)
  To: Michael Gatford; +Cc: gcc help

Michael,

  How is mapTags declared?

corey

On 7/20/05, Michael Gatford <michael.gatford@aprsmartlogik.com> wrote:
> Hi,
> 
> The following compiles ok with egcs-2.91.66 on Solaris (5.6/7/8), with
> gcc2.95.3 on Redhat 8.0 and VS6 on Windows, but not with GCC 4.0.0 on
> Fedora Core 4.
> 
> The following is defined in a header file
> 
> // Structure mapping a command name to a function to be
> // called, within a class-based context.
> template<class X> struct commandTags {
>     char* name;
>     void (X::*func)();
> };
> 
>  which is included by a program in which it is used like, e.g.
> 
> commandTags<FmPage> mapTags<FmPage>::mustags[] = {
>   { "page.include",        &FmPage::includeFile },
>   { "page.version",        &FmPage::printVersion },
>   { "page.script_name",    &FmPage::printScriptname },
>   { "page.gif_dir",        &FmPage::printGifdir },
> 
>    ........
>    ........
> }
> 
> This generates the error "too few template-parameter-lists".
> 
> Mike
> 
> --
> ___________________________________________________
> Michael Gatford
> Senior Technical Consultant
> ___________________________________________________
> APR Smartlogik Limited.
> Rustat House - Clifton Road - Cambridge - CB1 7EJ
> phone +44 (0)1223 27 1025
> fax   +44 (0)1223 27 1010
> map: http://www.aprsmartlogik.com/contact/CambridgeMap.pdf
> 
> mailto:michael.gatford@aprsmartlogik.com
> http://www.aprsmartlogik.com/
> 
> ***********************************************************************
> This e-mail may contain proprietary and confidential
> information and is intended for the recipient(s) only.
> If an addressing or transmission error has misdirected this
> e-mail, please notify the systems administrator by forwarding
> this e-mail to mailto:postmaster@aprsmartlogik.com.
> If you are not the intended recipient(s) disclosure, distribution,
> copying or printing of this e-mail is strictly prohibited.
> ***********************************************************************
> 
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: too few template-parameter-lists
  2005-07-20 15:49 ` Eljay Love-Jensen
@ 2005-07-20 15:47   ` Michael Gatford
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Gatford @ 2005-07-20 15:47 UTC (permalink / raw)
  To: Eljay Love-Jensen; +Cc: gcc help

Hi,

Many thanks once again. I have now compiled my code ok. There were 
basically four changes I had to make:

(1) to do with typename in a template
(2) the problem that you last emailed me about (use of a template)
3) changing the toupper in "std::transform(lang.begin(), lang.end(), 
lang.begin(), toupper);" to (int(*)(int))toupper);

(I'm not quite sure why because I don't include <cctype> and I believe 
there is only one toupper() in the code)

4) I had to change:

if (thisCgi.compare(prefix, 0, prefixLength) == 0) to
if (thisCgi.compare(0, prefixLength, prefix) == 0)

I think it's all working ok.

Mike

Many thanks

Eljay Love-Jensen wrote:

>Hi Michael,
>
>Try this...
>
>template<>
>commandTags<FmPage> mapTags<FmPage>::mustags[] = {
> { "page.include",        &FmPage::includeFile },
> { "page.version",        &FmPage::printVersion },
> { "page.script_name",    &FmPage::printScriptname },
> { "page.gif_dir",        &FmPage::printGifdir },
>
>  ........
>  ........
>}
>
>HTH,
>--Eljay
>
>  
>

-- 
___________________________________________________ 
Michael Gatford
Senior Technical Consultant
___________________________________________________ 
APR Smartlogik Limited.
Rustat House - Clifton Road - Cambridge - CB1 7EJ
phone +44 (0)1223 27 1025
fax   +44 (0)1223 27 1010
map: http://www.aprsmartlogik.com/contact/CambridgeMap.pdf

mailto:michael.gatford@aprsmartlogik.com 
http://www.aprsmartlogik.com/ 

***********************************************************************
This e-mail may contain proprietary and confidential 
information and is intended for the recipient(s) only. 
If an addressing or transmission error has misdirected this 
e-mail, please notify the systems administrator by forwarding 
this e-mail to mailto:postmaster@aprsmartlogik.com. 
If you are not the intended recipient(s) disclosure, distribution, 
copying or printing of this e-mail is strictly prohibited.
***********************************************************************

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: too few template-parameter-lists
  2005-07-20 14:51 too few template-parameter-lists Michael Gatford
  2005-07-20 15:36 ` corey taylor
@ 2005-07-20 15:49 ` Eljay Love-Jensen
  2005-07-20 15:47   ` Michael Gatford
  1 sibling, 1 reply; 4+ messages in thread
From: Eljay Love-Jensen @ 2005-07-20 15:49 UTC (permalink / raw)
  To: Michael Gatford, gcc help

Hi Michael,

Try this...

template<>
commandTags<FmPage> mapTags<FmPage>::mustags[] = {
 { "page.include",        &FmPage::includeFile },
 { "page.version",        &FmPage::printVersion },
 { "page.script_name",    &FmPage::printScriptname },
 { "page.gif_dir",        &FmPage::printGifdir },

  ........
  ........
}

HTH,
--Eljay

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-07-20 15:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-20 14:51 too few template-parameter-lists Michael Gatford
2005-07-20 15:36 ` corey taylor
2005-07-20 15:49 ` Eljay Love-Jensen
2005-07-20 15:47   ` Michael Gatford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).