Results 1 to 2 of 2

Thread: When to use templates thinking in the speed of the program.

  1. #1
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default When to use templates thinking in the speed of the program.

    I have read :
    "At that moment, when an instantiation is required, the compiler generates a function specifically for those arguments from the template."
    So, I think that is not very good idea to use a template for a function I'm going so uses 100.000 times ?
    Any advice ? Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: When to use templates thinking in the speed of the program.

    A template is instantiated at compile time. It has no influence on run time.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. How to accelerate the running speed of the qt program?
    By superwave in forum Qt Programming
    Replies: 5
    Last Post: 20th June 2011, 05:03
  2. help with templates please
    By GrahamLabdon in forum Newbie
    Replies: 2
    Last Post: 4th February 2011, 17:29
  3. "Thinking in C++" vol 2 book
    By mickey in forum General Discussion
    Replies: 2
    Last Post: 15th April 2008, 13:21
  4. templates
    By mickey in forum General Programming
    Replies: 5
    Last Post: 16th January 2008, 15:25
  5. Templates : Help Please
    By sunil.thaha in forum General Programming
    Replies: 4
    Last Post: 14th February 2006, 13:50

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.