Listing C


// John, James, Corina

std::cout << container( aNames);
 

// {John}, {James}, {Corina}

std::cout << container( aNames, formatter( "{", "}, {", "}")  );
 

// {[0] John}, {[1] James}, {[2] Corina}

std::cout << container( aNames, formatter( PrefixByIndex(), "{", "}, {","}") );
 

// [0] John, [1] James, [2] Corina

std::cout << container( aNames, formatter( PrefixByIndex()) );
 

// [John]

// [James]

// [Corina]

std::cout << container( aNames, formatter( "[", "]\n[", "]") );
 

// [0] John

// [1] James

// [2] Corina

std::cout << container( aNames, formatter( PrefixByIndex(), "\n") );
 

// '[0] John'

// '[1] James'

// '[2] Corina'

std::cout << container( aNames, formatter( PrefixByIndex(), "'", "'\n'", "'") );