forked from boostorg/iterator
Prohibit default construction of function_output_iterator on function pointers.
Default-constructed function_output_iterator with function pointers is unusable and previously would have contained an uninitialized function pointer. Disable the default constructor using SFINAE to prevent misuse. Also reformat code.
This commit is contained in:
@@ -58,6 +58,7 @@ test-suite iterator
|
||||
[ run function_input_iterator_test.cpp ]
|
||||
[ run function_output_iterator_test.cpp ]
|
||||
[ compile-fail function_output_iterator_cf.cpp ]
|
||||
[ compile-fail function_output_iterator_def_ctor_cf.cpp ]
|
||||
|
||||
[ run generator_iterator_test.cpp ]
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
// Copyright 2025 (c) Andrey Semashev
|
||||
// Distributed under the Boost Software License Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/iterator/function_output_iterator.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
boost::iterators::function_output_iterator< void (*)(int) > it;
|
||||
(void)it;
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user