//Purpose: // test if there exists filtering_stream::sync function. // #include template bool test() { bool dummy=false; typedef boost::iostreams::filtering_stream < Mode > out; auto mptr_strict=&out::strict_sync; dummy|=bool(mptr_strict); #if 1 auto mptr_sync=&out::sync; dummy|=bool(mptr_sync); #endif return dummy; } int main() { test(); test(); return 0; } //Result: /* /home/evansl/dwnlds/gcc/4.8-20121028/install/bin/g++ -c -O0 -gdwarf-2 -Wall -Wstrict-overflow -ftemplate-depth-300 -Wno-unused-local-typedefs -Wno-unused-but-set-variable -std=gnu++11 -I/home/evansl/prog_dev/boost/boost-svn/ro/boost_1_54_0/sandbox/rw/non_variadic_templates -I/home/evansl/prog_dev/boost/boost-svn/ro/boost_1_54_0 -DTEMPLATE_DEPTH=300 filtering_stream.sync.cpp -MMD -o filtering_stream.sync.o filtering_stream.sync.cpp: In function 'int main()': filtering_stream.sync.cpp:12:21: error: 'sync' is not a member of 'out {aka boost::iostreams::filtering_stream}' auto mptr_sync=&out::sync; ^ make: *** [filtering_stream.sync.o] Error 1 */