The example code assumes that x.begin() is implicitly convertible to const double *, but instead x.begin() returns a const_iterator type that can't be implicitly (or explicitly) converted to a pointer. Using x.data() instead of x.begin() corrects the problem.