I changed "template <class T, template <class T> class M = single_threaded>" to "template <class T, template <class X> class M = single_threaded>" as the second class T shadows the first one.