public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* incompatibility between g++ and vc++ (again)
@ 2004-06-15 22:13 Vincent Torri
  2004-06-16  5:41 ` Gabriel Dos Reis
  0 siblings, 1 reply; 7+ messages in thread
From: Vincent Torri @ 2004-06-15 22:13 UTC (permalink / raw)
  To: gcc-help


Hello,

i have another problem with vc+ and gcc. gcc does not like the syntax i
show below, whereas vc+ does not complain. Here is  piece of code:


class Dimension
{ ...
  template <int bps> Dimension Turn() const {.....} 
  ...
};


template <int bpp> class LeftTurner
{

public:

  BufferWindow operator()(BufferWindow const& source) const
  {
    BufferWindow result( source.GetDimension().Turn<bpp>(),
source.GetEnvironment() );

    //...

    return result;
  }

};

gcc does not like Turn<bpp>() in the leftturner class. I have the
following error : 
 
../../src/core/bufferwindow/leftturner.h: In member function
`avs::BufferWindow avs::bw::LeftTurner<bpp>::operator()(const
avs::BufferWindow&) const':
../../src/core/bufferwindow/leftturner.h:47: error: syntax error before
`;' token

I can trasform Turn into a "real" function. But i prefer not doing that.

Does someone understand why it does not work with g++ ?

Thank you !

Vincent TORRI


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

* Re: incompatibility between g++ and vc++ (again)
  2004-06-15 22:13 incompatibility between g++ and vc++ (again) Vincent Torri
@ 2004-06-16  5:41 ` Gabriel Dos Reis
  2004-06-16  5:55   ` Vincent Torri
  2004-06-18 21:24   ` incompatibility between g++ and vc++: Mutex Vincent Torri
  0 siblings, 2 replies; 7+ messages in thread
From: Gabriel Dos Reis @ 2004-06-16  5:41 UTC (permalink / raw)
  To: Vincent Torri; +Cc: gcc-help

You Wrote Vincent Torri
>
> Hello,
>
> i have another problem with vc+ and gcc. gcc does not like the syntax i
> show below, whereas vc+ does not complain. Here is  piece of code:
>
>
> class Dimension
> { ...
>   template <int bps> Dimension Turn() const {.....}
>   ...
> };
>
>
> template <int bpp> class LeftTurner
> {
>
> public:
>
>   BufferWindow operator()(BufferWindow const& source) const
>   {
>     BufferWindow result( source.GetDimension().Turn<bpp>(),
                                                ^^^^^
Say:

    source.GetDimension().template Turn<bpp>()

This is documented in our FAQ.

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

* Re: incompatibility between g++ and vc++ (again)
  2004-06-16  5:41 ` Gabriel Dos Reis
@ 2004-06-16  5:55   ` Vincent Torri
  2004-06-18 21:24   ` incompatibility between g++ and vc++: Mutex Vincent Torri
  1 sibling, 0 replies; 7+ messages in thread
From: Vincent Torri @ 2004-06-16  5:55 UTC (permalink / raw)
  To: Gabriel Dos Reis; +Cc: gcc-help



On Wed, 16 Jun 2004, Gabriel Dos Reis wrote:

> You Wrote Vincent Torri
> >
> > Hello,
> >
> > i have another problem with vc+ and gcc. gcc does not like the syntax i
> > show below, whereas vc+ does not complain. Here is  piece of code:
> >
> >
> > class Dimension
> > { ...
> >   template <int bps> Dimension Turn() const {.....}
> >   ...
> > };
> >
> >
> > template <int bpp> class LeftTurner
> > {
> >
> > public:
> >
> >   BufferWindow operator()(BufferWindow const& source) const
> >   {
> >     BufferWindow result( source.GetDimension().Turn<bpp>(),
>                                                 ^^^^^
> Say:
> 
>     source.GetDimension().template Turn<bpp>()
> 
> This is documented in our FAQ.

it works ;)

thanks a lot !

Vincent TORRI

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

* incompatibility between g++ and vc++: Mutex
  2004-06-16  5:41 ` Gabriel Dos Reis
  2004-06-16  5:55   ` Vincent Torri
@ 2004-06-18 21:24   ` Vincent Torri
  2004-06-18 23:25     ` Eljay Love-Jensen
  2004-06-25 12:40     ` incompatibility between g++ and vc++: Mutex (solved) Vincent Torri
  1 sibling, 2 replies; 7+ messages in thread
From: Vincent Torri @ 2004-06-18 21:24 UTC (permalink / raw)
  To: gcc-help


Hello,

i have another problem with this line: 

Mutex first & = &other < this ?  mutex_: other.mutex_;

There's an error with g++ (and none with vc++) : 
error: syntax error before `;' token

I don't understand why this does not work with a mutex.

Could someoe help me ?

Thanks !

Vincent TORRI


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

* Re: incompatibility between g++ and vc++: Mutex
  2004-06-18 21:24   ` incompatibility between g++ and vc++: Mutex Vincent Torri
@ 2004-06-18 23:25     ` Eljay Love-Jensen
  2004-06-19  8:23       ` Vincent Torri
  2004-06-25 12:40     ` incompatibility between g++ and vc++: Mutex (solved) Vincent Torri
  1 sibling, 1 reply; 7+ messages in thread
From: Eljay Love-Jensen @ 2004-06-18 23:25 UTC (permalink / raw)
  To: Vincent Torri, gcc-help

Hi Vincent,

Could you provide a short, compilable example that reproduced the problem?

(Compilable on VC++, but produces the error on GCC, of course.)

Are you using the /Za switch on VC++?  (To make VC++ more ANSI compliant.)

Thanks,
--Eljay

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

* Re: incompatibility between g++ and vc++: Mutex
  2004-06-18 23:25     ` Eljay Love-Jensen
@ 2004-06-19  8:23       ` Vincent Torri
  0 siblings, 0 replies; 7+ messages in thread
From: Vincent Torri @ 2004-06-19  8:23 UTC (permalink / raw)
  To: Eljay Love-Jensen; +Cc: gcc-help


Hello,

first, i have forgotten to say that we use boost library for mutex. It
seems that g++ does not like the conditional expression that we used.

I have written a small program (with 3 var and the line of my previous
post), which does not reproduce the same error, but which does not compile
anyway. I will give it to the guy which is involved in the windows port,
in order to know if this small program compile or not with vc++ (with or
without the /Za flag).

Once i will have his answer, i'll respond here.

Thank you very much !

Vincent TORRI

On Fri, 18 Jun 2004, Eljay Love-Jensen wrote:

> Hi Vincent,
> 
> Could you provide a short, compilable example that reproduced the problem?
> 
> (Compilable on VC++, but produces the error on GCC, of course.)
> 
> Are you using the /Za switch on VC++?  (To make VC++ more ANSI compliant.)
> 
> Thanks,
> --Eljay
> 
 

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

* Re: incompatibility between g++ and vc++: Mutex (solved)
  2004-06-18 21:24   ` incompatibility between g++ and vc++: Mutex Vincent Torri
  2004-06-18 23:25     ` Eljay Love-Jensen
@ 2004-06-25 12:40     ` Vincent Torri
  1 sibling, 0 replies; 7+ messages in thread
From: Vincent Torri @ 2004-06-25 12:40 UTC (permalink / raw)
  To: gcc-help; +Cc: Eljay Love-Jensen


> 
> Hello,
> 
> i have another problem with this line: 
> 
> Mutex first & = &other < this ?  mutex_: other.mutex_;
> 
> There's an error with g++ (and none with vc++) : 
> error: syntax error before `;' token

I have solved this problem
there were missing parenthesis... :

  Mutex first & = (&other) < this ?  mutex_: other.mutex_;

I don't know if, that case, vc++ would have given the wrong result.

Vincent TORRI

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

end of thread, other threads:[~2004-06-25 12:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-15 22:13 incompatibility between g++ and vc++ (again) Vincent Torri
2004-06-16  5:41 ` Gabriel Dos Reis
2004-06-16  5:55   ` Vincent Torri
2004-06-18 21:24   ` incompatibility between g++ and vc++: Mutex Vincent Torri
2004-06-18 23:25     ` Eljay Love-Jensen
2004-06-19  8:23       ` Vincent Torri
2004-06-25 12:40     ` incompatibility between g++ and vc++: Mutex (solved) Vincent Torri

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).