Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

CodeSignal

Designing Higher-Order Functions in C++

via CodeSignal

Overview

This course introduces you to advanced aspects of handling functions in C++. You'll learn about function pointers, storing functions as variables, and dynamic function operations, such as passing and returning functions, `std::bind`, and its alternatives.

Syllabus

  • Lesson 1: Storing a Function in a Variable
    • Storing Functions in C++ Variables Using Pointers and std::function
    • Replace Function Pointer with std::function
    • Use std::function Instead of Function Pointer
    • Space Exploration Thrust Calculation
    • Storing and Using Function Variables
  • Lesson 2: Implementing a Function that Takes Another Function as an Argument
    • Modify filterVector to Return Filtered Vector Instead of Printing
    • Quicksort Implementation with a Comparator Function
    • Modify Vector Elements with a Function Argument
    • Implementing a Reduce Function with Function Arguments
    • Transform Elements in a Vector
  • Lesson 3: Implementing a Function that Returns a Function
    • Fix the Faulty Incrementor Function
    • Implement a Multiplier Factory Function
    • Exponentiator Function Factory
    • Generating Personalized Greetings
    • Implement a Function that Returns a Boolean Function
  • Lesson 4: std::bind and Its Alternatives
    • Binding Function Arguments with std::bind
    • Replace std::bind with Lambda Expressions
    • Fix the Multiplication Binding
    • Bind Multiple Arguments and Create Equivalent Lambda Expressions

Reviews

Start your review of Designing Higher-Order Functions in C++

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.