Coding Tidbit

Software articles that can be consumed quickly

  • Home
  • About
  • January 8, 2018

    Pythonic Operators on STL Set Algorithms

      Table of Contents Introduction Set Intersection Set Union Set Difference Set Symmetric Difference Superset and Subset “I have no use for all these!” Introduction Ever since I started working with Python and that have gotten me into alot thinking how to redesign my libraries to be pythonic, if I were to implement them from […]

  • January 8, 2018

    C++ Summing For Loop Benchmark

      Introduction The initial motivation is to find out the overhead of different for-loop types in C++. Code Copy and paste below code into Godbolt Online C++ Compiler to see the generated assembly code. Note: The array or vector are initialized in the benchmark. The simplified code below is for you to copy and paste […]

  • January 2, 2018

    C++ Tip: Modification Inside const Function

      Introduction There are times where modification inside const member function must be done (for example, to allow for caching or memoization). The mutable keyword and const_cast are well-known in the C++ circles to work around these. The 3rd way is to use a const pointer; we cannot modify the const pointer but we can […]

  • January 1, 2018

    C++ Tip: Make Your Class Non-Copyable Without Boost

    Introduction There are times where an object should never be passed by copy but by reference or pointer. For instance, the class has a data member (like counter or mutex) which should not be duplicated. In this tip, we take a look at 2 techniques which declare the class to be non-copyable without resorting to using […]

←Previous Page
1 … 6 7 8

Blog at WordPress.com.

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
 

Loading Comments...
 

    • Follow Following
      • Coding Tidbit
      • Already have a WordPress.com account? Log in now.
      • Coding Tidbit
      • Edit Site
      • Follow Following
      • Sign up
      • Log in
      • Report this content
      • View site in Reader
      • Manage subscriptions
      • Collapse this bar