The Curious Engineer

All blogs / C++

Fluent C++

fluentcpp.com

Jonathan Boccara's blog

C++Software / engineering practice

Posts
443 from 4 Nov 2016 to 25 Jun 2022
Posting
quiet since 2022
Kind
personal blog
Feed
https://www.fluentcpp.com/feed/

2022 11

  1. Usage First, Implementation After: A Principle of Software Development
  2. Design Patterns VS Design Principles: Factory method
  3. How to Store an lvalue or an rvalue in the Same Object
  4. Copy-Paste Developments
  5. Design Patterns VS Design Principles: Abstract Factory
  6. How to Generate All the Combinations from Several Collections
  7. Code It Yourself: Generate All the Combinations from Several Collections
  8. A Good Way to Handle Errors Is To Prevent Them from Happening in the First Place
  9. Design Patterns VS Design Principles: Visitor
  10. Which Programming Paradigm Gives the Most Expressive Code?
  11. The Interesting Evolution of std::equal_range

2021 45

  1. A Simple Habit to Avoid Complex Names and Typos in Code
  2. The Evolutions of Lambdas in C++14, C++17 and C++20
  3. How to Quickly Understand the Code of a Function
  4. Design Patterns VS Design Principles: Template Method
  5. CPPP – An international C++ Conference with a hint of French accent
  6. Strong Types for Safe Indexing in Collections – Part 2
  7. Strong Types for Safe Indexing in Collections – Part 1
  8. Design Patterns VS Design Principles: Observer, State and Strategy
  9. A Recap on User Defined Literals
  10. A Case Study for the Quickest Way to Find the Source of a Bug
  11. 3 Steps to Find the Source of a Bug Quickly
  12. Design Patterns VS Design Principles: Iterator, Mediator and Memento
  13. How to Make Your Classes Compatible with Range for Loop
  14. How to Define Comparison Operators by Default in C++
  15. How Template Template Parameters Can Simplify Template Classes
  16. Don’t Let Legacy Code Make You Suffer. Make It Suffer
  17. Design Patterns VS Design Principles: Chain of responsibility, Command and Interpreter
  18. Extended Aggregate Initialisation in C++17
  19. How to Return Several Values from a Function in C++
  20. Minor, Major and Overarching Design Principles
  21. GRASP: 9 Must-Know Design Principles for Code
  22. 5 Tips to Find Your Way Around A Legacy Codebase
  23. How to Define A Variadic Number of Arguments of the Same Type – Part 5
  24. How to Insert Several Elements in a Vector (With No Memory Errors)
  25. The Subtle Dangers of Temporaries in for Loops
  26. A Default Value to Dereference Null Pointers
  27. Find with Custom Returns
  28. How to Implement std::conjunction and std::disjunction in C++11
  29. Make Bad Code Look Bad
  30. Trailing Return Types
  31. Open Question: Should the Logging Code Be with the Main Code?
  32. What auto&& means
  33. “Can’t” Is No Word for Software Developers
  34. What C++ Fold Expressions Can Bring to Your Code
  35. C++ Fold Expressions 101
  36. std::index_sequence and its Improvement in C++20
  37. C++ Concepts: More than Syntactic Requirements
  38. A Recap on string_view
  39. 6 Tips to Make Your Development Project More Likely to Succeed
  40. How std::any Works
  41. Inheritance Without Pointers
  42. How to Pass a Variadic Pack as a First Argument of a Function in C++
  43. 4 Features of Boost HOF That Will Make Your Code Simpler
  44. Infix Function Calls with Boost HOF
  45. Include What You Use

2020 63

  1. Fluent C++ is 4 Years Old
  2. On Design Patterns in C++
  3. A Classic Compilation Error with Dependent Types
  4. Auto for Types, but Not for Concepts
  5. A Map with Two Types of Keys in C++
  6. Announcing the Fluent C++ Store
  7. How Lambdas Make Function Extraction Safer
  8. How to Make a Copyable Object Assignable in C++
  9. How to Write Expressive Class Definitions
  10. An Attempt to Write Fallbacks With Expressive Code
  11. The differences between tie, make_tuple, forward_as_tuple: How to Build a Tuple in C++?
  12. Adapting STL Algorithms on Sets
  13. How to Implement operator= When a Data Member Is a Lambda
  14. std::exchange Patterns: Fast, Safe, Expressive, and Probably Underused
  15. What std::exchange does, and how to remember it
  16. Replacing CRTP Static Polymorphism With Concepts
  17. Make Your September Matter
  18. Use Private Inheritance to Restrict Interfaces
  19. Algorithms on Sets That Return a Boolean: Strong Templates Interface
  20. Algorithms on Sets That Return a Boolean: Implementing the Generic Algorithm
  21. If you see cut-paste, it is rotate
  22. Algorithms on Sets That Return a Boolean: Exploring the algorithms
  23. STL Algorithms on Sets: One Algorithm to Implement Them All
  24. Implementing set_match in One Line of Code
  25. set_match: Matching up Elements Between Sorted Collections
  26. How to Check If 2 Sorted Collections Have a Common Element
  27. A Universal Reference Wrapper
  28. Great Developers Don’t Just Write Great Code
  29. A Generic Component for Out-of-line Lambdas
  30. Out-of-line Lambdas
  31. Going Far into Polymorphic Helpers
  32. How to Assign Derived Classes in C++
  33. Runtime Polymorphism Without Objects or Virtual Functions
  34. Evaluating user-defined logical expressions
  35. How to Modify a Key in a C++ Map or Set
  36. Else Before If
  37. How to Extract Words among Spaces in a C++ String
  38. An Online Source Code Control Flow Filter
  39. Implementing a Line Filter by Using C++ Ranges
  40. Implementing a Line Filter in C++
  41. See you on Friday
  42. How Can Developers Help Fight Coronavirus?
  43. How to Get the “Table of Contents” Of a Long Function
  44. 3 Types of Toxic Software Projects
  45. How to Pass Class Member Functions to STL Algorithms
  46. Checking the Values of a Collection in a Unit Test in C++
  47. C++ Regex 101
  48. Coding Styles With Exotic Constraints
  49. Virtual, final and override in C++
  50. How to Make for_each Stop When a Condition Is True
  51. How to Make for_each Stop After N Elements
  52. Reverse For Loops in C++
  53. Various Ways of Applying a Function to the Elements of a Collection in C++
  54. My Interview on Software Engineering Radio
  55. How to Combine Functions with Logical Operators in C++
  56. How to Short-Circuit a Sequence of Operations with a Boolean Value
  57. Mikado Refactoring with C++ Feature Macros
  58. Rockstool Interview
  59. Technical Debt Is like a Tetris Game
  60. The Shapes of Code
  61. No Raw For Loops: Assigning to a Data Member
  62. How to Define A Variadic Number of Arguments of the Same Type – Part 4
  63. Dry-comparisons: A C++ Library to Shorten Redundant If Statements

2019 105

  1. The Dangers of Coupling and How to Avoid Them
  2. Lower and Upper Bound Insert Iterators
  3. My Christmas Gift For You
  4. Comparing C++ Containers with Lexicographical Comparison
  5. How to Increment a Dynamic Bitset with the STL
  6. How to Write a Condition With Interdependent Variables
  7. Don’t Make Your Interfaces *Deceptively* Simple
  8. My Book on Legacy Code is on Amazon
  9. Inserting Values to a Map with Boost.Assign
  10. Appending Values to a Vector with Boost.Assign
  11. NEW! Get a Mini-Ebook on a C++ Topic Every Month
  12. How C++17 Benefits from Boost Libraries, Part Two
  13. How C++17 Benefits from Boost Libraries, Part One
  14. 5 Ways Using Braces Can Make Your C++ Code More Expressive
  15. Fluent C++ Is 3 Years Old
  16. New Pipes + a Video Tutorial to Make More Pipes
  17. Mux: Zip Without Tuples
  18. Transforming Deeply Nested Loops With STL Algorithms
  19. std::less and its Modern Evolutions
  20. A Tree of Pipes
  21. A Pipe Operator for the Pipes Library?
  22. Piping To and From a Stream
  23. How to Merge Consecutive Elements in a C++ Collection
  24. Code It Yourself: Merging Consecutive Elements in a C++ Collection
  25. My Leanpub Interview
  26. How to Create Your Own C++ Pipe
  27. Reducing the Code to Create a Pipe in the Pipes Library
  28. How to Check If an Inserted Object Was Already in a Map (with Expressive Code)
  29. Expressive Code for State Machines in C++
  30. Composite Pipes, part 2: Implementing Composite Pipes
  31. Composite Pipes, part 1: Decoupling Operators From Classes
  32. The Surprising Limitations of C++ Ranges Beyond Trivial Cases
  33. Good News for the Pipes Library: pipes::funnel Is Now Gone
  34. I Don’t Know What You Did Last Summer
  35. The Demux Pipe
  36. How to Disable a Warning in C++
  37. Extract Function: Should I Extract the Condition Too?
  38. How to Make SFINAE Pretty and Robust
  39. A Concise Implementation of Fizzbuzz with std::optional
  40. Making C++ Pipes Compatible with STL Algorithms
  41. Smart Output Iterators >>= become(Pipes)
  42. Combining Ranges and Smart Output Iterators
  43. Chaining Output Iterators Into a Pipeline
  44. My C++Now Talk on Smart Output Iterators
  45. Why Static Analysis Can Improve a Complex C++ Codebase
  46. Strong Types on Collections
  47. What Every C++ Developer Should Know to (Correctly) Define Global Constants
  48. Expressiveness, Nullable Types, and Composition (Part 2)
  49. Expressiveness, Nullable Types, and Composition (Part 1)
  50. auto + const + smart pointer = bad mix?
  51. You Should Refuse to Develop What You Don’t Understand
  52. FSeam: A Mocking Framework That Requires No Change In Code (Part 2)
  53. FSeam: A Mocking Framework That Requires No Change In Code (Part 1)
  54. How to Use is_permutation on Collections of Different Types
  55. Understanding the implementation of std::is_permutation
  56. The Cons and Cons of the Hungarian Notation
  57. The Shortest Name There Is
  58. Should Private Methods Always Be Const?
  59. Why You Should Separate Commands from Queries
  60. Write Your Own Dependency-Injection Container
  61. Get Better with Legacy Code This Summer (Limited Offer)
  62. The Difference Between std::copy_backward and std::copy with Reverse Iterators
  63. Better Macros, Better Flags
  64. How to Generate a Collection of Random Numbers in Modern C++
  65. The Expressive Absence of Code
  66. How to Check If a String Is a Prefix of Another One in C++
  67. 3 Types of Macros That Improve C++ Code
  68. How to Send an STL Collection to a Curried Object
  69. How to Output Strings Separated by Commas in C++
  70. Curried Objects in C++
  71. The Common Vocabulary of Software Developers
  72. Beyond Locks, a Safer and More Expressive Way to Deal with Mutexes in C++
  73. The Rule of Zero in C++
  74. Compiler-generated Functions, Rule of Three and Rule of Five
  75. An Alternative Design to Iterators and Ranges, Using std::optional
  76. Cppp
  77. How to Emulate the Spaceship Operator Before C++20 with CRTP
  78. The BooSTL Algorithms: Boost Algorithms That Extend the STL (3/3)
  79. The BooSTL Algorithms: Boost Algorithms That Extend the STL (2/3)
  80. The BooSTL Algorithms: Boost Algorithms That Extend the STL (1/3)
  81. 10 Code Smells a Static Analyser Can Locate in a Codebase
  82. Generalizing Unordered Named Arguments
  83. Anna
  84. Performance benchmark: Ranges VS STL algorithms VS Smart output iterators
  85. The Demultiplexer Iterator: Routing Data to Any Numbers of Outputs
  86. STL Algorithms on Tuples
  87. for_each_arg: Applying a Function to Each Argument of a Function in C++
  88. Partitioning Data with Output Iterators in C++
  89. Is Unzip a Special Case of Transform?
  90. Applying Several Transforms in One Pass on a Collection
  91. Unzipping a Collection of Tuples with the “unzip” Smart Output Iterator
  92. How Smart Output Iterators Avoid the TPOIASI
  93. The Terrible Problem Of Incrementing A Smart Iterator
  94. Why You Should Use std::for_each over Range-based For Loops
  95. How to Define A Variadic Number of Arguments of the Same Type – Part 3
  96. The Legacy Code Programmer’s Toolbox is Out
  97. How to Define A Variadic Number of Arguments of the Same Type – Part 2
  98. How to Define a Variadic Number of Arguments of the Same Type – Part 1
  99. The Pitfalls of Aliasing Pointers in Modern C++
  100. Declarative If Statements with a Simplified Rules Engine
  101. Indexing Data Structures with C++ Scoped Enums
  102. How I Applied Coding Best Practices to Improve My Daily Life
  103. RestMyCase: A C++ Library for Formatting String Cases
  104. Functional Programming Is Not a Silver Bullet
  105. TODO_BEFORE(): A Cleaner Codebase for 2019

2018 104

  1. A Simple Timer in C++
  2. A Free Ebook on C++ Smart Pointers
  3. The SoA Vector – Part 2: Implementation in C++
  4. The SoA Vector – Part 1: Optimizing the Traversal of a Collection
  5. Named Arguments in C++
  6. Overview of std::map’s Insertion / Emplacement Methods in C++17
  7. Algorithms on Ranges
  8. An Extraterrestrial Guide to C++ Formatting
  9. How to Design Function Parameters That Make Interfaces Easier to Use (3/3)
  10. How to Design Function Parameters That Make Interfaces Easier to Use (2/3)
  11. How to Design Function Parameters That Make Interfaces Easier to Use (1/3)
  12. Deprecating and Deleting Functions in C++
  13. Fluent C++ is 2 Years Old
  14. To DRY or not to DRY?
  15. How to Retrieve the Firsts from a Collection of Pairs
  16. How to Transfer unique_ptrs From a Set to Another Set
  17. How to Store a Variable Number of Objects Known at Compile Time in C++
  18. A Case Where Using Auto Leads to Undefined Behaviour
  19. How to Access the Index of the Current Element in a Modern For Loop
  20. Word Counting in C++: Computing the Span of a Word
  21. Word Counting in C++: Parametrizing the Type of Case
  22. Word Counting in C++: Extracting words from camelCase symbols
  23. Word Counting in C++: Implementing a Simple Word Counter
  24. 3 Things That Counting Words Can Reveal on Your Code
  25. Why Optional References Didn’t Make It In C++17
  26. Pointers, References and Optional References in C++
  27. “auto to stick” and Changing Your Style
  28. How to Remove Duplicates from an Associative Container in C++
  29. How to Remove Elements from an Associative Container in C++
  30. How to Remove Pointers from a Vector in C++
  31. How to Remove Elements from a Sequence Container in C++
  32. How to Write Simple Code to Accomplish Complex Tasks
  33. How to Deal with Values That Are Both Input and Output
  34. Function Poisoning in C++
  35. Modern C++: 7 Ways to Fake It Until You Have It
  36. Removing Duplicates in C++ CRTP Base Classes
  37. How to Design Early Returns in C++ (Based on Procedural Programming)
  38. Integrating Mocking With C++ Default Parameters
  39. Implementing Default Parameters That Depend on Other Parameters in C++
  40. Defaulted: A Helper to Work Around the Constraints of C++ Default Parameters
  41. Default Parameters With Default Template Parameters Types
  42. Should I Use Overloads or Default Parameters?
  43. Default Parameters in C++: The Facts (Including Secret Ones)
  44. Getting Along With The Comma Operator in C++
  45. How to *Efficiently* Convert a String to an int in C++
  46. How to Convert a String to an int in C++
  47. Simplicity in C++ Code (Podcast)
  48. How to Construct C++ Objects Without Making Copies
  49. The Incredible Const Reference That Isn’t Const
  50. 105 STL Algorithms in Less Than an Hour
  51. The World Map of C++ STL Algorithms
  52. How to Reduce the Code Bloat of a Variadic CRTP
  53. 7 More Ways to Get Better at C++ This Summer (2018 Edition)
  54. Variadic CRTP Packs: From Opt-in Skills to Opt-in Skillsets
  55. Variadic CRTP: An Opt-in for Class Features, at Compile Time
  56. 3 Simple C++17 Features That Will Make Your Code Simpler
  57. Should structs Have Constructors in C++
  58. Triple trip report from ACCU, C++ Russia and C++Now 2018 – Part 2
  59. Triple trip report from ACCU, C++ Russia and C++Now 2018 – Part 1
  60. 10 Techniques That Will Make You Understand Other People’s Code Better
  61. Fluent C++ is open to guest posting
  62. A Concrete Example of Naming Consistency
  63. Beautiful Pieces of Code That Print 42 for Towel Day
  64. How to Turn a Hierarchy of Virtual Methods into a CRTP
  65. How to Make SFINAE Pretty – Part 2: the Hidden Beauty of SFINAE
  66. How to Make SFINAE Pretty – Part 1: What SFINAE Brings to Code
  67. The Most Beautiful Piece of Code That Prints 42
  68. std::iterator is deprecated: Why, What It Was, and What to Use Instead
  69. Passing Booleans to an Interface in an Expressive Way
  70. When to Use Enums and When to Use Tag Dispatching in C++
  71. How to Use Tag Dispatching In Your Code Effectively
  72. Make Your Containers Follow the Conventions of the STL
  73. How to Reorder A Collection With the STL
  74. How to Pass a Polymorphic Object to an STL Algorithm
  75. Moving Ranges Around with STL Algorithms
  76. Which One Is Better: Map of Vectors, or Multimap?
  77. Getting the Benefits of Strong Typing in C++ at a Fraction of the Cost
  78. C++ Will No Longer Have Pointers
  79. Is std::for_each obsolete?
  80. Buy me a beer for Fluent C++
  81. What Heaps Can Do That Priority Queues Don’t
  82. Heaps and Priority Queues in C++ – Part 3: Queues and Priority Queues
  83. Building, Unbuilding and Sorting Heaps in C++ with the STL
  84. Heaps and Priority Queues in C++ – Part 1: Heaps Basics
  85. The C++ Metaclasses Proposal in Less Than 5 Minutes
  86. The Issues With Singletons and How to Fix Them
  87. How to Choose Between Struct or Class
  88. Replacing an Else-if Sequence With a Ternary Operator
  89. Introduction to Boost Karma
  90. On Using Guards in C++
  91. The Right Question for the Right Name
  92. To RAII or Not to RAII?
  93. Introduction to the C++ Ranges Library
  94. Understanding lvalues, rvalues and their references
  95. Strong Types For Strong Interfaces: my talk at Meeting C++
  96. The Most Vexing Parse: How to Spot It and Fix It Quickly
  97. Introduction to Boost Phoenix
  98. How to Be Clear About What Your Functions Return
  99. 5 Tips to Understand Legacy Code
  100. Strong Optionals
  101. How is std::set_difference Implemented?
  102. Strong Templates
  103. Making Strong Types Implicitly Convertible
  104. 7 Good Resolutions to Write Better Code This Year

2017 104

  1. STL Algorithms on Sets
  2. How to Emulate The “super” Keyword In C++
  3. Why Expressive Code Matters
  4. The Complete Guide to Building Strings In C++: From “Hello World” Up To Boost Karma
  5. More Tips On Naming
  6. Mixin Classes: The Yang of the CRTP
  7. Make Your Functions Functional!
  8. A Minimal Interface: Both Expressive And Fast Code
  9. 7 Names We Should Never See in Code
  10. Smart Output Iterators: A Symmetrical Approach to Range Adaptors
  11. How to Use the STL With Legacy Output Collections
  12. Using Bad Code to Learn How to Write Good Code
  13. Fluent C++ Is 1 Year Old
  14. Getting Inspired by Good Code
  15. Using Strong Types to Return Multiple Values
  16. Calling Functions and Methods on Strong Types
  17. How Unit Tests Help Express Your Code’s Intent
  18. 10 Halloween Horror Code Stories That Will Freak You Out
  19. Function Aliases In C++
  20. The Results of the Expressive C++17 Coding Challenge
  21. Think of Function Objects as Functions Rather Than Objects
  22. (std::)Accumulate Knowledge On STL Algorithms
  23. Size and Capacity of STL Containers
  24. Partitioning with the STL
  25. How the STL inserter iterator really works
  26. Sorting with the STL algorithms
  27. tee: Debug Info With Little Impact On Code
  28. The Expressive C++17 Coding Challenge
  29. How to implement the pimpl idiom by using unique_ptr
  30. Cppcast: A Show for All C++ Developers
  31. Spread Knowledge in Your Company with Your “Daily C++”
  32. How to Return a Smart Pointer AND Use Covariance
  33. Polymorphic clones in modern C++
  34. Changing deleters during the life of a unique_ptr (4/7)
  35. How to Make Custom Deleters More Expressive
  36. Smart developers use smart pointers (3/7) – Custom deleters
  37. unique_ptr, shared_ptr, weak_ptr, scoped_ptr, raw pointers – Knowing your smart pointers (2/7)
  38. Smart developers use smart pointers (1/7) – Smart pointers basics
  39. How to Handle Multiple Types in Max Without A Cast
  40. Function Templates Partial Specialization in C++
  41. Template Partial Specialization In C++
  42. Metaclasses, the Ultimate Answer to Strong Typing in C++?
  43. A Summary of the Metaclasses Proposal for C++
  44. How to Use Overloaded Functions With The STL
  45. What Books to Read to Get Better In C++
  46. Do Understandable If Statements Run Slower?
  47. How to Make If Statements More Understandable
  48. Can You Wield C++ Function Overloading Like Jon Snow Wields Longclaw?
  49. The Vector Monad in C++, Without the Ugly Stuff
  50. Dealing with Multiple Paths with the Vector Monad in C++
  51. The Optional Monad In C++, Without the Ugly Stuff
  52. Multiple error handling with the optional monad in C++
  53. How to Insulate a Toxic Api from the Rest of Your Code
  54. How to Flatten Out A Nested Switch Statement
  55. 7 Ways to Get Better at C++ During this Summer
  56. The Interface Principle in C++
  57. The Right Attitude to Deal with Legacy Code
  58. The real difference between struct and class
  59. is_transparent: How to search a C++ set with another type than its key
  60. Using toString on Custom Types in C++
  61. Expressive C++ Template Metaprogramming
  62. Making Strong Types Hashable
  63. Strong Units Conversions
  64. Strong types: inheriting the underlying type’s functionalities
  65. An Implementation Helper For The Curiously Recurring Template Pattern
  66. What the Curiously Recurring Template Pattern can bring to your code
  67. The Curiously Recurring Template Pattern (CRTP)
  68. How Compact Code Can Become Buggy Code: Getting Caught By The Order of Evaluations
  69. Good news: strong types are (mostly) free in C++
  70. To comment or not to comment? // that is the question
  71. The “Extract Interface” refactoring, at compile time
  72. Move iterators: where the STL meets Move semantics
  73. How to split a string in C++
  74. The design of the STL
  75. Understand ranges better with the new Cartesian Product adaptor
  76. Mins and Maxes with the STL
  77. Restricting an interface in C++
  78. The Dailies: how to efficiently teach C++ at work
  79. How typed C++ is, and why it matters
  80. Inserting several elements into an STL container efficiently
  81. Filling <algorithm>s of the STL
  82. A smart iterator for aggregating new elements with existing ones in a map or a set
  83. A smart iterator for inserting into a sorted container in C++
  84. The Pi Day Challenge for the Most Expressive Code – Results
  85. Functors are not dead: the double functor trick
  86. Passing strong types by reference
  87. The Pi Day Challenge For The Most Expressive Code In C++
  88. 50 People’s Opinions About How To Get Better As A Software Developer
  89. Predicates on ranges with the STL
  90. Strong lambdas: strong typing over generic types
  91. Custom comparison, equality and equivalence with the STL
  92. std::transform, a central algorithm
  93. set_aggregate, set_segregate: higher-level algorithms on sets
  94. What 70 people came up with on expressive code
  95. The searching <algorithm>s the STL holds secret
  96. How to choose good names in your code
  97. Searching when you have access to an STL container
  98. STL Function objects: Stateless is Stressless
  99. Making code expressive with lambdas
  100. How to (std::)find something efficiently with the STL
  101. Ranges: the STL to the Next Level
  102. Know your algorithms: algos on sets
  103. The importance of knowing STL <algorithm>s
  104. Super expressive code by Raising Levels of Abstraction

2016 11

  1. Can you write expressive code? – Christmas break challenge
  2. It all comes down to respecting levels of abstraction
  3. Passing strong types by reference – First attempt
  4. Strong types for strong interfaces
  5. Strongly typed constructors
  6. Partial queries with optional<T>
  7. Return value optimizations
  8. Clearer interfaces with optional<T>
  9. Make your functions functional
  10. How I came to create Fluent C++
  11. Becoming Fluent in C++