Re: Confusion
Posted: Sun Jan 23, 2011 8:25 am
I concurxiphirx wrote:Stopped reading there.Code: Select all
typedef std::vetcor<Instance> Vetcor;
The Next Generation of 2D Roleplaying Games
http://elysianshadows.com/phpBB3/
I concurxiphirx wrote:Stopped reading there.Code: Select all
typedef std::vetcor<Instance> Vetcor;
You're really not understanding what people are asking are you?THe Floating Brain wrote:Beacuse I did not want to deal with pre-prosser commands
Code: Select all
Instance MyClass {
};
also, please understand that a specific syntax is used by the language for a very specific reason. Using preprocessor to CHANGE the syntax of the language is like trying to chop off someone's legs just because you like midgets better.D-e-X wrote:I'm giving you a tip, man, just please... go through the fundamentals of C++ one more time, and this time, make sure you UNDERSTAND every concept and how to use it... or at least, please brush up on it.
^ this is true.Ginto8 wrote:also, please understand that a specific syntax is used by the language for a very specific reason. Using preprocessor to CHANGE the syntax of the language is like trying to chop off someone's legs just because you like midgets better.D-e-X wrote:I'm giving you a tip, man, just please... go through the fundamentals of C++ one more time, and this time, make sure you UNDERSTAND every concept and how to use it... or at least, please brush up on it.
What a genius way of putting it....Ginto8 wrote:also, please understand that a specific syntax is used by the language for a very specific reason. Using preprocessor to CHANGE the syntax of the language is like trying to chop off someone's legs just because you like midgets better.D-e-X wrote:I'm giving you a tip, man, just please... go through the fundamentals of C++ one more time, and this time, make sure you UNDERSTAND every concept and how to use it... or at least, please brush up on it.
crazy analogies are my specialtyN64vSNES wrote:What a genius way of putting it....Ginto8 wrote:also, please understand that a specific syntax is used by the language for a very specific reason. Using preprocessor to CHANGE the syntax of the language is like trying to chop off someone's legs just because you like midgets better.D-e-X wrote:I'm giving you a tip, man, just please... go through the fundamentals of C++ one more time, and this time, make sure you UNDERSTAND every concept and how to use it... or at least, please brush up on it.
Code: Select all
typedef float(*pFunc)(args, ...);
pFunc foo(args, ...);
Code: Select all
typedef struct
{
bla bla bla
} bla, *pBla;
Code: Select all
std::vector<std::pair<std::string, int> > values;
for (std::vector<std::pair<std::string, int> >::const_iterator i = values.begin(); i != values.end(); ++i)
{
std::pair<std::string, int> const & t = *i;
// do something
}
Code: Select all
typedef std::pair<std::string, int> value_t;
typedef std::vector<value_t> values_t;
values_t values;
for (values_t::const_iterator i = values.begin(); i != values.end(); ++i)
{
value_t const & t = *i;
// do something
}
I am well aware that a class is not a instance. The purpose of this function is to feed a instance of a class into a element of a std::vector or a array.A class is not an instance, and therefore should not be called one.
I fully understand the fundamentals of C++, maybe im a little messy in my work but I do understand C++.I'm giving you a tip, man, just please... go through the fundamentals of C++ one more time, and this time, make sure you UNDERSTAND every concept and how to use it... or at least, please brush up on it.
Thank you avansc The whole reason for this typedef is simply to make things easier!usually to make things easier on the programmer, after all, is that not what programming is about?
I already explained that I was using that to test stuff (although agreed it is bad practices) and I forgot to take it out.GroundUpEngine wrote:I concurxiphirx wrote:Stopped reading there.Code: Select all
typedef std::vector<Instance> Vector;
How is that trolling?!?!?!xiphirx wrote:watTHe Floating Brain wrote:Because I did not want to deal with pre-prosser commands
are you a troll by chance?
Would you please listen to what people are saying? typedef's are there to make things easier but they're not to be abused.THe Floating Brain wrote:Well lots of talk on this while I was gone XD. Reason being for that is just to make it easier to take any instance of any class for a function argument (the implimentation for this is show in the topic post).I am well aware that a class is not a instance. The purpose of this function is to feed a instance of a class into a element of a std::vector or a array.A class is not an instance, and therefore should not be called one.I fully understand the fundamentals of C++, maybe im a little messy in my work but I do understand C++.I'm giving you a tip, man, just please... go through the fundamentals of C++ one more time, and this time, make sure you UNDERSTAND every concept and how to use it... or at least, please brush up on it.Thank you avansc The whole reason for this typedef is simply to make things easier!usually to make things easier on the programmer, after all, is that not what programming is about?I already explained that I was using that to test stuff (although agreed it is bad practices) and I forgot to take it out.GroundUpEngine wrote:I concurxiphirx wrote:Stopped reading there.Code: Select all
typedef std::vector<Instance> Vector;
How is that trolling?!?!?!xiphirx wrote:watTHe Floating Brain wrote:Because I did not want to deal with pre-prosser commands
are you a troll by chance?
Code: Select all
warning C4091: 'typedef ' : ignored on left of 'Instance' when no variable is declared
Correct term is "Developmentaly Challanged" use of the word "retared" is outdated. (Have worked with poeple whom actualy have that realy sad ).To typedef the class keyword is just retarded.
It is the updated term (http://www.wordwebonline.com/en/DEVELOP ... CHALLENGED)(basicly a more polite version of the term) I do not want to start a fight so that is all I will say. Anyway moving onto softwere development.Ginto8 wrote:The term is mental retardation. They're very stupid because either their brain is not fully developed or it just doesn't function correctly, but being "Developmentally Challenged" is ambiguous and definitely not descriptive enough. Please cut the PC bullshit here.
Also, the "any instance of any class" thing makes me think you're looking for polymorphism, or simply templating. Which it is, I can't tell, because your description is too vague and your understanding is obviously too little.
Code: Select all
//pseudo code.//
template<class Instance>
Instance CreateInstance(Instance A)
{
return A;
}
class food
{
public:
};
food pizza;
std::vector<food> B;
B.push_back(CreateInstance(pizza));