From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13160 invoked by alias); 10 Jul 2010 18:45:58 -0000 Received: (qmail 13140 invoked by uid 48); 10 Jul 2010 18:45:48 -0000 Date: Sat, 10 Jul 2010 18:45:00 -0000 Message-ID: <20100710184548.13139.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/44906] g++ is giving error: parse error in template argument list while using a c++ code. In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "raychaudhuri_amitava at yahoo dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-07/txt/msg01155.txt.bz2 ------- 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