Skip to content
This repository has been archived by the owner on Dec 22, 2022. It is now read-only.

Modern CPP Features

Muhammad Osama edited this page Dec 15, 2021 · 2 revisions

Important to know the following modern C++ features when working with gunrock/essentials. Please familiarize yourself with these before looking at the Programming API.

Lambda Expressions (since C++11)

Constructs a closure: an unnamed function object capable of capturing variables in scope.

A simple example.

auto sample_lambda = [=] __host__ __device__(int blah) -> bool {
    return true;
};

Variadic Arguments (since C++11)

Allows a function to accept any number of extra arguments. Indicated by a trailing ... (other than one introducing a pack expansion) (since C++11) following the parameter-list of a function declaration.

  • Extensively used within the implementation of graph_t class.
template <memory_space_t space,
          typename vertex_t,
          typename edge_t,
          typename weight_t,
          class... graph_view_t>
class graph_t : public graph_view_t... { 
    // ... implementation.
}

Constexpr (since C++11)

constexpr - specifies that the value of a variable or function can appear in constant expressions

Getting Started

Experimentals

Developers

Debugging, Profiling and Testing

Tutorials

Design Choices

Utilities and Tools

Performance Optimizations

Random, weird or fun things

Continuous integration (CI)

Clone this wiki locally