473,409 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,409 software developers and data experts.

properties within Templates

this seems ok:

template<class T> ref class MyTemplateClass
{
String^ get_Name() { return nullptr; }; void set_Name( String^ ) {};
//...
};

but this throws an error

template<class T> ref class MyTemplateClass
{
property String^ Name { String^ get() { return nullptr; }; void set( String^
) {}; }
//...
};

"error C2814: 'MyTemplateClass<T>::Name' defined inside
'MyTemplateClass<T>', nested type must be a value class, ref class or
interface class"

are properties not allowed/recognized inside of templates?
Nov 17 '05 #1
2 947
It compiles for me. Have you installed the latest update?

http://tinyurl.com/5mdq2

Tamas

Christian Lammel wrote:
this seems ok:

template<class T> ref class MyTemplateClass
{
String^ get_Name() { return nullptr; }; void set_Name( String^ ) {};
//...
};

but this throws an error

template<class T> ref class MyTemplateClass
{
property String^ Name { String^ get() { return nullptr; }; void set( String^
) {}; }
//...
};

"error C2814: 'MyTemplateClass<T>::Name' defined inside
'MyTemplateClass<T>', nested type must be a value class, ref class or
interface class"

are properties not allowed/recognized inside of templates?

Nov 17 '05 #2
already got the compiler tools update from the first reply (where did this
post go?)
and it works

but thank you anyway

"Tamas Demjen" wrote:
It compiles for me. Have you installed the latest update?

http://tinyurl.com/5mdq2

Tamas

Christian Lammel wrote:
this seems ok:

template<class T> ref class MyTemplateClass
{
String^ get_Name() { return nullptr; }; void set_Name( String^ ) {};
//...
};

but this throws an error

template<class T> ref class MyTemplateClass
{
property String^ Name { String^ get() { return nullptr; }; void set( String^
) {}; }
//...
};

"error C2814: 'MyTemplateClass<T>::Name' defined inside
'MyTemplateClass<T>', nested type must be a value class, ref class or
interface class"

are properties not allowed/recognized inside of templates?

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jon Slaughter | last post by:
Lets assume I want to write a whole host of classes having "property" elements in them and create a bunch of objects from the different classes. Lets suppose that they are circles, lines, etc......
2
by: Brian | last post by:
NOTE ALSO POSTED IN microsoft.public.dotnet.framework.aspnet.buildingcontrols I have solved most of my Server Control Collection property issues. I wrote an HTML page that describes all of the...
1
by: Earl Teigrob | last post by:
I have a DataGrid that needs to set many properites on its embeded controls in the ItemTemplate and EditItemTemplate Templates. I have a choice between using the inline <%# %> or the OnItemCreated...
11
by: Brent Ritchie | last post by:
Hello all, I have been using C# in my programming class and I have grown quite fond of C# properties. Having a method act like a variable that I can control access to is really something. As...
0
by: george_Martinho | last post by:
It seems that the ASP.NET Microsoft team didn't think about this!! The profilemanager class has the following methods: - DeleteInactiveProfiles. Enables you to delete all profiles older than a...
0
by: Giorgio | last post by:
It seems that the ASP.NET Microsoft team didn't think about this!! The profilemanager class has the following methods: - DeleteInactiveProfiles. Enables you to delete all profiles older...
3
by: Michael Matteson | last post by:
I have two classes. Class A and Class B. I give class A 5 properties int prop1(){} int prop2(){} int prop3(){} int prop4(){} classB prop5(){} what i would like to do is to create a 5th...
4
by: evantay | last post by:
I'm using ASP.NET 2.0 with VS.NET 2005. I'm trying to access properties from my master pages within a page that inherits from that master page (a child page). However the values are always null....
0
by: jay11 | last post by:
Hello peeps I am trying to run a banner with SWFObject from within PHP/Mambo. I have two others SWF in the same page, so I know it works. Also checked the Developer tool in Chrome and saw that...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.