Skip to content

Add Scott Meyer's advice #2

@richelbilderbeek

Description

@richelbilderbeek

From @richelbilderbeek on October 4, 2015 10:49

From @richelbilderbeek on June 1, 2014 15:22

From http://cppandbeyond.com/2012/04/16/session-topic-initial-thoughts-on-effective-c11:

    Prefer auto to Explicit Type Declarations
    Distinguish () and {} When Creating Objects
    Remember that auto + { expr } == std::initializer_list
    Prefer non-member begin/end to member versions
    Declare std::thread Members Last in Classes
    Be Wary of Default Capture Modes in Lambdas Escaping Member Functions
    Prefer Emplacement to Insertion
    Pass std::launch::async if Asynchronicity is Essential
    Minimize use of Weak Atomics
    Distinguish Rvalue References from Universal References
    Assume that move operations are neither present nor cheap
    Prefer Lambdas over Binders
    Prefer Lambdas over Variadic Arguments to Threading Functions
    Be Wary of Oversubscription
    Apply std::forward when Passing Universal References
    Prefer std::array to Built-in Arrays
    Use std::make_shared Whenever Possible
    Prefer Pass-by-Reference-to-const to Pass-by-Value for std::shared_ptrs
    Pass by Value if You’ll Copy Your Parameter
    Reserve noexcept for Functions with Wide Interfaces
    For Copyable Types, View Move as an Optimization of Copy
    Prefer enum classes to enums
    Prefer nullptr to NULL and 0
    Distinguish among std::enable_if, static_assert, and =delete

Copied from original issue: richelbilderbeek/ProjectRichelBilderbeek#216

Copied from original issue: richelbilderbeek/RichelbilderbeekNl#3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions