Results 1 to 2 of 2

Thread: qobject_cast "good coding practice"

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 163 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: qobject_cast "good coding practice"

    I prefer the 2nd. It states what really must be passed (whereas the 1st lets the compiler tolerate errors that will manifest themselves at runtime).
    (Exceptions are when you inherit a class and have no choice in the signature.)

  2. The following user says thank you to caduel for this useful post:

    janus (17th October 2008)

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
  •  
Qt is a trademark of The Qt Company.