| 1 | //Purpose:
|
|---|
| 2 | // test if there exists filtering_stream<Mode>::sync function.
|
|---|
| 3 | //
|
|---|
| 4 | #include <boost/iostreams/filtering_stream.hpp>
|
|---|
| 5 | template<typename Mode>
|
|---|
| 6 | bool test()
|
|---|
| 7 | {
|
|---|
| 8 | bool dummy=false;
|
|---|
| 9 | typedef
|
|---|
| 10 | boost::iostreams::filtering_stream
|
|---|
| 11 | < Mode
|
|---|
| 12 | >
|
|---|
| 13 | out;
|
|---|
| 14 | auto mptr_strict=&out::strict_sync;
|
|---|
| 15 | dummy|=bool(mptr_strict);
|
|---|
| 16 | #if 1
|
|---|
| 17 | auto mptr_sync=&out::sync;
|
|---|
| 18 | dummy|=bool(mptr_sync);
|
|---|
| 19 | #endif
|
|---|
| 20 | return dummy;
|
|---|
| 21 | }
|
|---|
| 22 | int main()
|
|---|
| 23 | {
|
|---|
| 24 | test<boost::iostreams::input>();
|
|---|
| 25 | test<boost::iostreams::output>();
|
|---|
| 26 | return 0;
|
|---|
| 27 | }
|
|---|
| 28 | //Result:
|
|---|
| 29 | /*
|
|---|
| 30 | /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
|
|---|
| 31 | filtering_stream.sync.cpp: In function 'int main()':
|
|---|
| 32 | filtering_stream.sync.cpp:12:21: error: 'sync' is not a member of 'out {aka boost::iostreams::filtering_stream<boost::iostreams::output>}'
|
|---|
| 33 | auto mptr_sync=&out::sync;
|
|---|
| 34 | ^
|
|---|
| 35 | make: *** [filtering_stream.sync.o] Error 1
|
|---|
| 36 | */
|
|---|