Vladimir Prus


vladimirprus.com

Tuesday, December 13, 2005

Whatever you name them

I've just wrote the following code:
void on_vector_write(unsigned address, unsigned address)
    {
        if (w_on_vector_write)
            w_on_vector_write(address,
    }
It's not complete -- I was just about to pass a second parameter to "w_on_vector_write" when I realized that the two parameters of my function have the same name. But heh, I've just copy-pasted that signature, and the code I've pasted from certainly compiles. Here's how that compiling code looks:
boost::function<void (unsigned address,unsigned address)> 
    on_vector_write;
Apparently, gcc does not care about parameter names that are used when forming function type. And it does not care about function names in function prototypes either, even in 4.0.

1 comment:

samsung firmware said...

Great post, can you share more info