Skip to main content
GameDev.net gamedev.net
🔒 Locked

Implicit defenitions

Started by Goozer Jan 25, 2003 at 9:45 AM 0 replies 200+ views
Original Post
Goozer
Goozer
Well I started developing in the linux enviorment with gcc, i like it a lot btw, but anyway it started popping up some neat warnings about implicit defenitions... Program still runs but well i kinda like wanna know why it shows up and what i did wrong with my defenition of the function. dont have any code at this comp but i was wondering if i could get some kind of hint to what its about Thanks in advance. - Goozer
LilBudyWizer
LilBudyWizer
I can't say for sure, but one possibility is leaving the return type off a function declaration in which case it is assumed to be an integer. Another is implying template function parameters from the function arguements. If you have template < typename T > T f(T value) then you can call that as either f(a) or f < type > (a). In the first T is implied by the type of a. The second is explicitly stating T. Since you normally call it as f(a) and only explicitly state the type when you want to use some type other than a's type it seems a strange thing to issue a warning on. The only other thing I can think of is arguement dependant lookup (ADL). If you call f(N::T) then it will look in N for f. You can look at that as the scope of f is implied by the scope of its parameters. Well, not really the scope of f, but rather the scope of the expression calling f.

Frigging templates and their angle brackets.

[edited by - LilBudyWizer on January 25, 2003 12:50:08 PM]
Keys to success: Ability, ambition and opportunity.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.