DBSCAN in C++ for general and Android use
Naming things

Why you have all caps function name?

Why you have variable with capital letter in expandCluster()?
At first I thought it is template parameter i miss.

Use auto more often:

// looks ugly
for (node&lt;T&gt;*&amp; n : neighbourhood) {
}

// looks better
for (auto &amp; n : neighbourhood) {
     // adjust for * here
}

// or you can do with using
using mynode = node&lt;T&gt;;

// still looks better
for (mynode* &amp; n : neighbourhood) {
}


DBSCAN()

Make this a type:

template&lt;class T&gt;
using something = std::vector&lt;cluster&lt;T&gt;&gt;


Why you pass dataset_size by reference?

size_t is as big as the pointer, but there will be additional hidden dereference that will slow down the execution.
keep the const, remove &amp;

size_t const dataset_size


Do the same for all non class parameters.

dataset

probably I am wrong, but if you type this:

T* const&amp; dataset


like this:

const T* dataset


will be same, but more readable? Not sure what T is. If T is a container or array, why not just:

const CONTAINER dataset


Why you pass C like function pointers?

Do it with functor class. Or with std::function.

I am not very experienced with this, so I will do it with functor, but will add it into template parameters.

expandCluster()

more or less similar comments.