« Some more fishing around the evil elves conspiracy | Main | The plot thickens in the fight vs. the bug elves »

The idiocy of too strong typing

While perusing the Xcode Users mailing list archives I found this beauty:

I'd like to write a quick function template to change a function pointer from type " return_type (*)(void) " to "return_type (*)(...)".  I thought this would work:
template <typename RetT>
RetT (*convert_ptr(...)) ( RetT (*src)(void) ) { 
   typedef RetT (*rt)(...); 
  return reinterpret_cast(src); 
  //ERROR: "src" was not declared in this scope.
}

The whole code functionally is a big bag of nothing. It's all syntax. Spending time programming this stuff is about as worthwhile as reformatting TPS reports.

The C-solution is (or should be, if it hasn't been broken by some committee by now) convert_ptr = (void *) src , which means: I know what I am doing, don't bother me even with warnings, I have better things to do.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About

This page contains a single entry from the blog posted on December 22, 2009 6:15 PM.

The previous post in this blog was Some more fishing around the evil elves conspiracy.

The next post in this blog is The plot thickens in the fight vs. the bug elves.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 4.25