
#include <vector>
#include <algorithm>
#include <iostream>
#include <cctype>
#include <string>

struct Comp{

    auto get_num (const std::string& a)
    {
        auto it1 = std::find_if( a.begin(), a.end(), ::isdigit );
        auto it2 = std::find_if( a.begin(), a.end(), [](char x){ return x == '.' ;}) ;
        /* Do some checks here for std::string::npos*/
        auto pos1 = std::distance(  a.begin(), it1) ;
        auto pos2 = std::distance(  it1, it2) ;
        return std::stoi (a.substr( pos1, pos2 )) ;
    }

    bool operator () (const std::string& a, const std::string& b)  
    {
        return  get_num (a) < get_num (b) ;
    }

};


int main ()
{

    std::vector <std::string> vec {
    "some_name_10.xyz",
    "some_name_1.xyz",
    "some_name_2.xyz",
    "some_name_12.xyz",
    "some_name_3.xyz"
    };

   std::sort( vec.begin() , vec.end(), Comp());

   for(auto x: vec)
	 std::cout << x << std::endl;

}