As SilentStrike has stated use templates; then if you want to ensure that something is done when you use the function with a specific type, create a specialisation.
Type: Posts; User: Sorensen
As SilentStrike has stated use templates; then if you want to ensure that something is done when you use the function with a specific type, create a specialisation.
What do you mean by difference? One runs on a standalone PC and the other runs across a network. If you want to know the differences involved in creating them then maybe a search engine or book may...
>I have to make sure the pointer points to a valid instance of any class that is derived from an abstract base class.
Then you shouldn't be using a void pointer. Use a pointer to the base class.
Yes if you insert an assignment operator after the subscript.
I'm not sure what you're up to, but you could use templates to overload on return type -
template <class T>
class population
{
public :
virtual T getindividual(){return 0;}
};
WinNT doesn't give you direct access to anything outside your processes virtual memory space without some form of driver or hack. Do a search for 'giveio' in your favourite search engine.
The syntax should be something like -
#include <iostream>
using namespace std;
void solver(int x){
if (x == 0)
throw ("x found to be 0") ;
As you've discovered, the compiler needs to see the full definition of a class before an instance of it can be constructed (it needs to know how big the object will be). The pointer version works...
An STL way might be something like -
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
using namespace std;
>When did I ever mention anything but the basic loop I made?<
Sorry I had no idea why you posted the asm. I assumed it was an attempt to justify your desicion not to turn on your compilers...
You could convert to the largest possible type. It doesn't sound like you're using templates properly, though.
>but would z be 159.000 etc... or would it come out with a completely random, something like 159.31415298?<
From the standard -
So it should be 159.000 if possible.
Well, I'm sure you probably didn't mean it but that could be optimised to one instruction quite easily if it could be established that it resulted in an infinite loop.
However, there probably...
>1) Let's see, optimization comes off in Dev-C++ unless you turn it on. Also, I know some people that keep it off just to make sure that things they don't want done aren't done. <
Then don't be...
> But the most important thing is that there things which you can't do in a high-level language, like interfacing directly with the hardware.<
This statement is false.
>I think that ASM will...
While this is true, portabiliy isn't just about crossing platforms but also about future portability. A hard coded asm executable will always remain the same. The theory is, if you were to upgrade...
>>In ygf's post, if you turned off compiler optimization<<
Why would you do that?
>>Although goto is shunned, it can be used efficiently in some situations.<<
Not this one. If you really...
What compiler are you using? There may be a debug version of operator new being called. Also, you should use the standard headers.
Perhaps you need to post some code; the description of your problem is as clear as mud. Have you implemented your own resevre and capacity functions for Hello? Or are you refering to the std::vector...
You create an array of 4 COption's then try and assign to 5 of them in your mainMenu() function.
>I'm not here for a long time, as someone else already said. But it's already irritating how these questions keep getting asked over and over and over again. <
We're not at all interested in your...
In that case -
*ReturnedObject = g->GeneralDX.d3d8;
You'll always have to de-reference the pointer to pointer otherwise your attempted return of an address will go out of scope.
What does g->GeneralDX.d3d8 return?
Check the FAQ.
Try -
*ReturnedObject = &g->GeneralDX.d3d8;