473,386 Members | 1,758 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,386 software developers and data experts.

from generic type to closed type

In my method

Method<T>()
{
//... some stuff
}

How can I know the real type of T?
Inviato da X-Privat.Org - Registrazione gratuita http://www.x-privat.org/join.php
Apr 28 '06 #1
4 1289
typeof(T)
Apr 28 '06 #2
Type t = typeof(T) ?

--
======================
Clive Dixon
Digita Ltd. (www.digita.com)
"Tommaso Caldarola" <il********@lcimitero.it> wrote in message
news:44**********@x-privat.org...
In my method

Method<T>()
{
//... some stuff
}

How can I know the real type of T?
Inviato da X-Privat.Org - Registrazione gratuita
http://www.x-privat.org/join.php

Apr 28 '06 #3
"Tommaso Caldarola" <il********@lcimitero.it> a écrit dans le message de
news: 44**********@x-privat.org...

| In my method
|
| Method<T>()
| {
| //... some stuff
| }
|
| How can I know the real type of T?

In addition to other answers, I would comment : if you need to know the real
type in a generic method, you don't need a generic method.

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer
Apr 28 '06 #4
Joanna Carter [TeamB] wrote:
"Tommaso Caldarola" <il********@lcimitero.it> a écrit dans le message de
news: 44**********@x-privat.org...

| In my method
|
| Method<T>()
| {
| //... some stuff
| }
|
| How can I know the real type of T?

In addition to other answers, I would comment : if you need to know the real
type in a generic method, you don't need a generic method.


Clear, I'm just trying some things, no real context.

--

Inviato da X-Privat.Org - Registrazione gratuita http://www.x-privat.org/join.php
Apr 28 '06 #5

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

Similar topics

467
by: mike420 | last post by:
THE GOOD: 1. pickle 2. simplicity and uniformity 3. big library (bigger would be even better) THE BAD:
8
by: kasper.rung | last post by:
I have a problem formulating a test to see if an object is implementing a generic interface. I have the following: public interface IGeneric<T> { void Foo(); }
4
by: Queen Soso | last post by:
hi all, I have this error when I click delete link in the gridview: 'unable to cast object of type 'ASP.WebForm1_aspx' to type "system.Web.UI.WebControls.GridviewRow' I really need help as...
0
amitpatel66
by: amitpatel66 | last post by:
There is always a requirement that in Oracle Applications, the Concurrent Program need to be execute programatically based on certain conditions/validations: Concurrent programs can be executed...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.