Boost logo

Boost Users :

From: John.Wismar_at_[hidden]
Date: 2005-04-25 16:25:24


I'm compiling at Warning Level 4, using VC.NET 2003, and Boost 1.32.0. Is
there something I can do to eliminate these warnings, or should I just
suppress them? Am I using the concept checking functions improperly?

Thanks for any help!

--------------------------------
John Wismar
john.wismar_at_[hidden]

--------------------------------------------------------------------------------------------------

Here's some very stripped-down code:

#include <boost/concept_check.hpp>
#include <vector>
#include <fstream>
#include <iterator>

struct DirectoryEntry
{
};
std::istream &operator>>(std::istream &is, DirectoryEntry&) { return is; }

template <typename InputIterator, typename OutputIterator>
OutputIterator process (InputIterator, OutputIterator dest)
{
    boost::function_requires<boost::InputIteratorConcept<InputIterator>
>();
    boost::function_requires<boost::OutputIteratorConcept<OutputIterator,
                             typename std::iterator_traits<InputIterator>::
value_type> >();
    return dest;
}

int main(int, char*[])
{
    std::ifstream input;
    std::vector<DirectoryEntry> directoryVector;
    process(std::istream_iterator<DirectoryEntry>(input), std::
back_inserter(directoryVector));
    return 0;
}

This generates the following warnings:

Compiling...
concepttest.cpp
c:\boost\boost\concept_check.hpp(573) : warning C4510:
'boost::OutputIteratorConcept<TT,ValueT>' : default constructor could not
be generated
        with
        [
            TT=std::back_insert_iterator<std::vector<DirectoryEntry>>,

ValueT=std::iterator_traits<std::istream_iterator<DirectoryEntry>>::value_type
        ]
        c:\boost\boost\concept_check.hpp(48) : see reference to class
template instantiation 'boost::OutputIteratorConcept<TT,ValueT>' being
compiled
        with
        [
            TT=std::back_insert_iterator<std::vector<DirectoryEntry>>,

ValueT=std::iterator_traits<std::istream_iterator<DirectoryEntry>>::value_type
        ]
        c:\Temp\concepttest\concepttest.cpp(16) : see reference to function
template instantiation 'void
boost::function_requires<boost::OutputIteratorConcept<TT,ValueT>>(boost::mpl::identity<T>
 *)' being compiled
        with
        [
            TT=std::back_insert_iterator<std::vector<DirectoryEntry>>,

ValueT=std::iterator_traits<std::istream_iterator<DirectoryEntry>>::value_type,

T=boost::OutputIteratorConcept<std::back_insert_iterator<std::vector<DirectoryEntry>>,std::iterator_traits<std::istream_iterator<DirectoryEntry>>::value_type>
        ]
        c:\Temp\concepttest\concepttest.cpp(24) : see reference to function
template instantiation 'OutputIterator
process<std::istream_iterator<_Ty>,std::back_insert_iterator<_Container>>(InputIterator,OutputIterator)'
 being compiled
        with
        [

OutputIterator=std::back_insert_iterator<std::vector<DirectoryEntry>>,
            _Ty=DirectoryEntry,
            _Container=std::vector<DirectoryEntry>,
            InputIterator=std::istream_iterator<DirectoryEntry>
        ]
c:\boost\boost\concept_check.hpp(573) : warning C4610: struct
'boost::OutputIteratorConcept<TT,ValueT>' can never be instantiated - user
defined constructor required
        with
        [
            TT=std::back_insert_iterator<std::vector<DirectoryEntry>>,

ValueT=std::iterator_traits<std::istream_iterator<DirectoryEntry>>::value_type
        ]
c:\boost\boost\concept_check.hpp(234) : warning C4510:
'boost::AssignableConcept<TT>' : default constructor could not be generated
        with
        [
            TT=std::back_insert_iterator<std::vector<DirectoryEntry>>
        ]
        c:\boost\boost\concept_check.hpp(48) : see reference to class
template instantiation 'boost::AssignableConcept<TT>' being compiled
        with
        [
            TT=std::back_insert_iterator<std::vector<DirectoryEntry>>
        ]
        c:\boost\boost\concept_check.hpp(566) : see reference to function
template instantiation 'void
boost::function_requires<boost::AssignableConcept<TT>>(boost::mpl::identity<T>
 *)' being compiled
        with
        [
            TT=std::back_insert_iterator<std::vector<DirectoryEntry>>,

T=boost::AssignableConcept<std::back_insert_iterator<std::vector<DirectoryEntry>>>
        ]
        c:\boost\boost\concept_check.hpp(565) : while compiling
class-template member function 'void
boost::OutputIteratorConcept<TT,ValueT>::constraints(void)'
        with
        [
            TT=std::back_insert_iterator<std::vector<DirectoryEntry>>,

ValueT=std::iterator_traits<std::istream_iterator<DirectoryEntry>>::value_type
        ]
        c:\boost\boost\concept_check.hpp(48) : see reference to class
template instantiation 'boost::OutputIteratorConcept<TT,ValueT>' being
compiled
        with
        [
            TT=std::back_insert_iterator<std::vector<DirectoryEntry>>,

ValueT=std::iterator_traits<std::istream_iterator<DirectoryEntry>>::value_type
        ]
        c:\Temp\concepttest\concepttest.cpp(16) : see reference to function
template instantiation 'void
boost::function_requires<boost::OutputIteratorConcept<TT,ValueT>>(boost::mpl::identity<T>
 *)' being compiled
        with
        [
            TT=std::back_insert_iterator<std::vector<DirectoryEntry>>,

ValueT=std::iterator_traits<std::istream_iterator<DirectoryEntry>>::value_type,

T=boost::OutputIteratorConcept<std::back_insert_iterator<std::vector<DirectoryEntry>>,std::iterator_traits<std::istream_iterator<DirectoryEntry>>::value_type>
        ]
c:\boost\boost\concept_check.hpp(234) : warning C4610: struct
'boost::AssignableConcept<TT>' can never be instantiated - user defined
constructor required
        with
        [
            TT=std::back_insert_iterator<std::vector<DirectoryEntry>>
        ]


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net