This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/44906] g++ is giving error: parse error in template argument list while using a c++ code.
- From: "raychaudhuri_amitava at yahoo dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Jul 2010 18:45:48 -0000
- Subject: [Bug c++/44906] g++ is giving error: parse error in template argument list while using a c++ code.
- References: <bug-44906-19425@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from raychaudhuri_amitava at yahoo dot com 2010-07-10 18:45 -------
(In reply to comment #4)
> The error message is not clear. The issue is that you are not using a constant
> expression for a template arugment. Template arguments are either constant
> expressions or types.
>
Whenever I will be using this kind of template in a class, the variable name is
predefined. Now when I create an object and call the function, it will get the
address offset and thus should be able to create an instance of that function
with same prototype but different body, else for such cases we have to create
different functions for each member.
Can it be a new feature in g++ compiler? This will make function and objects as
first class citizen in C++. We can create function at runtime with different
object embedded in it. (I know it can be done by #define, but this is a better
way I think.)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44906