static void fn_node_string_substring_build_multi_function( blender::nodes::NodeMultiFunctionBuilder &builder) { static blender::fn::CustomMF_SI_SI_SI_SO substring_fn{ "Substring", [](const std::string &str, int a, int b) { using namespace boost::locale::boundary; boost::locale::generator gen; std::string output; std::string locale = "en_EN.UTF-8"; // Create mapping of text for token iterator using global locale. ssegment_index map(word, locale.begin(), locale.end(), gen(locale)); // Print all "words" -- chunks of word boundary for (ssegment_index::iterator it = map.begin(), e = map.end(); it != e; ++it) { output += *it; } return std::move(output); }}; builder.set_matching_fn(&substring_fn); }