blog Latest

C++: Pattern Matching Template Types

How to check if a template type matches a pattern? Something like is_like_v<T, vector<int,_>>.

10 min read

2 Mar 24

blog

C++: Overloading the Spaceship Operator, A Recipe

How to overload the three-way comparison (spaceship) operator<=>, and a reminder to overload operator== as well.

5 min read

9 Feb 24

blog

C++: Check if a type is an instantiation of a given class template

How to implement an is_instance_of type trait.

6 min read

5 Feb 24

blog

C++: Forwarding references, overload resolution, and taking back control

Consider merging overloads into one function with forwarding reference parameters

7 min read

27 Jan 24

blog

C++: Disable implicit conversion in specific contexts only

You get one implicit conversion, so burn it with a wrapper

4 min read

14 Nov 23

blog

C++: Revisiting combinatorial instantiation of templates with std::variant

Compiler optimizations can break it, function attributes can fix it.

4 min read

16 Aug 23

blog

C++: Combinatorial instantiation of templates with std::variant

An alternative to explicit instantiations and macros.

5 min read

11 Jun 23

blog

C++: Avoiding Argument Dependent Lookup

A little trick using an extra namespace and cross-import.

4 min read

30 Apr 23

blog

Sums of Discrete Random Variables as Banded Matrix Products

Zero-stride catch and a custom CUDA kernel.

Sums of Discrete Random Variables as Banded Matrix Products

32 min read

16 Mar 23

blog
Fast Enumeration of Sums of Discrete Random Variables

14 min read

22 Feb 23

blog

Fix Scaling Issues on KDE Plasma

In case of issues switching between Wayland and X11

1 min read

22 Jan 23

blog

Profile in the Cloud with Nsight Systems

How to profile CUDA code on cloud GPU instances using Nsight Systems.

2 min read

13 Jan 23