Writing a collection of overloaded display functions for each instantiated BoundsCheckedArray can rapidly become an overwhelming maintenance burden. Instead, consider whether you can write a template function.
One potential difficulty is getting the name of the type parameter to pass to TV_ttf_add_row. Here we follow the convention used by the container classes in the standard library which typedefs the template type parameter to the standard name
value_type.
Here we want to tell TotalView to display the array horizontally as a string instead of vertically as an array. For this reason, we want to pass TV_ttf_type_ascii_string to
TV_ttf_add_row as the name of the type instead of the name constructed by the implementation of the general template display function. We therefore define a special version of the display function to handle
BoundsCheckedArray<char>.
One remaining issue relating to templates is arranging for the various template display function instances to be instantiated. It is unlikely that display functions will be called directly by your program. (Indeed, we mentioned earlier that TV_ttf_add_row should not be called other than as a result of a call initiated by TotalView.) Consequently, the template functions may well not be generated automatically. You can either arrange for functions to be referenced, such as by calling them in a controlled manner, or by explicit template instantiation: