[info] type_name = "std::basic_string" stub_template_params = [2] ctype = "STRING_TYPE" header = "string" # Old: typeName = "std::basic_string<" ns = ["namespace std"] numTemplateParams = 1 replaceTemplateParamIndex = [] [codegen] decl = """ template void getSizeType(const %1% &container, size_t& returnArg); """ func = """ template void getSizeType(const %1% &container, size_t& returnArg) { SAVE_SIZE(sizeof(%1%)); SAVE_DATA((uintptr_t)container.capacity()); SAVE_DATA((uintptr_t)container.size()); // Test for small string optimisation - whether the underlying string is // contained within the string object. SAVE_SIZE( ((uintptr_t)container.data() < (uintptr_t)(&container + sizeof(%1%))) && ((uintptr_t)container.data() >= (uintptr_t)&container) ? 0 : (container.capacity() * sizeof(T)) ); } """