[algorithms][num_segments] replace unnecessary "typename" by "inline"