#include "internal.h" // len returns the length of the string. int str·len(const string s) { Hdr* h = (Hdr*)(s - sizeof(Hdr)); return h->len; } // cap returns the capacity of the string buffer. int str·cap(const string s) { Hdr* h = (Hdr*)(s - sizeof(Hdr)); return h->cap; }