0

Why is the keyword typename used in the return type of the operator overloading? How having it makes difference?

typename boost::detail::sp_member_access< T >::type operator-> () const 
{
    BOOST_ASSERT( px != 0 );
    return px;
}
Saurav Sahu
  • 9,755
  • 5
  • 42
  • 64
  • @KerrekSB FGITW-ed me to the dupevote :) – sehe Sep 30 '16 at 09:09
  • @sehe: Training, habit, fast F5-cycles, and a helpful heuristic that prepopulated the answer! – Kerrek SB Sep 30 '16 at 09:10
  • My failure was due to writing "When" initially, instead of "Where". :( – sehe Sep 30 '16 at 09:11
  • No one liner answer. Have to read that long post.. :| – Saurav Sahu Sep 30 '16 at 09:14
  • 2
    @SauravSahu: Oh no! You have to _read_ and _study_ in order to _understand_! Whatever will you do!! Seriously, you will not go very far with that level of laziness. Your profile says you're a good enough engineer to be employed by Microsoft, so surely you understand the value of spending ten minutes reading and studying some documentation? – Lightness Races in Orbit Sep 30 '16 at 09:15
  • Thanks.. I like reading and learning from you guys...going through the post...:) – Saurav Sahu Sep 30 '16 at 09:17
  • 1
    EVEN BETTER. No need to read it at all. Just accept that `template` is there, and don't worry about it :/ – sehe Sep 30 '16 at 09:37

0 Answers0