Re: __LINE__ as template argument (VC++)
From: Martin Stettner (nospam_at_martin.dot.stettner.at.complement.dot.at)
Date: 02/23/05
- Next message: Sigurd Lerstad: "dynamically creating object"
- Previous message: usenet_at_sta.samsung.com: "Different behavior from __LINE__ macro in g++ 2.95.x and 3.x"
- In reply to: Imre: "__LINE__ as template argument (VC++)"
- Next in thread: Peter Gordon: "Re: __LINE__ as template argument (VC++)"
- Reply: Peter Gordon: "Re: __LINE__ as template argument (VC++)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 23 Feb 2005 02:24:45 +0100
Imre wrote:
>
> template <int Line>
> struct Test
> {
> enum { value = Line };
> };
>
> int main(int argc, char *argv[])
> {
> int i = Test<__LINE__>::value;
> return 0;
> }
>
> Visual C++ 7.1 refuses to compile it, giving this error message for the
> line in main where Test<__LINE__> is referenced:
>
> Imre
>
Sorry for being late ...
My VC-compiler doesn't complain about the above code (VS 2003, shows up
as Version 7.1.3088 in the about dialog...)
-- Martin
- Next message: Sigurd Lerstad: "dynamically creating object"
- Previous message: usenet_at_sta.samsung.com: "Different behavior from __LINE__ macro in g++ 2.95.x and 3.x"
- In reply to: Imre: "__LINE__ as template argument (VC++)"
- Next in thread: Peter Gordon: "Re: __LINE__ as template argument (VC++)"
- Reply: Peter Gordon: "Re: __LINE__ as template argument (VC++)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]