Embedded Linux

Device Drivers,linux,fedora,kernel programming

Monday, 11 September 2017

auto and decltype

// function that returns a 'reference to int' type
int& fun() {   }

// m will default to int type instead of
// int& type
auto m = fun();

// n will be of int& type because of use of
// extra & with auto keyword
auto& n = fun();


Posted by Unknown at 08:53
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

About Me

Unknown
View my complete profile

Device Drivers

  • ▼  2017 (19)
    • ►  November (1)
    • ▼  September (18)
      • Threads
      • Important C++ concepts
      • Smart pointer impementation + explicit keyword + c...
      • Exceptions Handling in C++
      • static functions cannot be virtual
      • Abstract class, sizeof class with virtual function
      • auto and decltype
      • Default vs delete
      • Casting
      • Create .so in linux & dynamic vs static libraries
      • Function pointers
      • virtual destructors
      • malloc() vs new, wild, dangling ptr
      • Headers for macros, system calls etc
      • Templates in c++
      • STL
      • const, static important examples must see. Referen...
      • Interrupts in linux
  • ►  2016 (7)
    • ►  August (2)
    • ►  July (3)
    • ►  May (2)
  • ►  2015 (13)
    • ►  December (1)
    • ►  November (1)
    • ►  June (3)
    • ►  April (3)
    • ►  March (4)
    • ►  January (1)
  • ►  2014 (15)
    • ►  September (2)
    • ►  August (3)
    • ►  July (4)
    • ►  June (6)
Picture Window theme. Powered by Blogger.