If void is a type used in the instantiation of std::unary_function, there are
issues. Same for std::pointer_to_unary_function.

I don't see much discussion of this, so maybe my usage is off.

Here are some examples:

// 1
#include <functional>

typedef int     value_type;

// void argument type
template class std::unary_function<void, value_type>;
template class std::pointer_to_unary_function<void, value_type>;

// void return type
template class std::unary_function<value_type, void>;
template class std::pointer_to_unary_function<value_type, void>;


And more specific things:

// 2
#include <functional>
void foo() { };

// pointer_to_unary_function
void test01()
{
  typedef std::pointer_to_unary_function<void, void> pfunc;
  pfunc p(&foo);
}


// 3
#include <functional>
// unary_function
struct void_unary : public std::unary_function<void, void>
{ 
  typedef std::unary_function<void, void> base_type;
  typedef base_type::Arg argument_type;
  typedef base_type::Result result_type;
};


Is this usage standards-conforming?


-- 
           Summary: unary_function and pointer_to_unary_function issues with
                    void template arguments
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bkoz at gcc dot gnu dot org
 GCC build triplet: all
  GCC host triplet: all
GCC target triplet: all


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33628

Reply via email to