//: C05:DotTemplate.cpp // From "Thinking in C++, Volume 2", by Bruce Eckel & Chuck Allison. // (c) 1995-2004 MindView, Inc. All Rights Reserved. // See source code use permissions stated in the file 'License.txt', // distributed with the code package available at www.MindView.net. // Illustrate the .template construct. #include #include #include #include using namespace std; template basic_string bitsetToString(const bitset& bs) { return bs. template to_string, allocator >(); } int main() { bitset<10> bs; bs.set(1); bs.set(5); cout << bs << endl; // 0000100010 string s = bitsetToString(bs); cout << s << endl; // 0000100010 } ///:~