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@autozone.com
--------------------------------------------------------------------------------------------------
Here's some very stripped-down code:
#include
#include <vector>
#include <fstream>
#include <iterator>
struct DirectoryEntry
{
};
std::istream &operator>>(std::istream &is, DirectoryEntry&) { return is; }
template
OutputIterator process (InputIterator, OutputIterator dest)
{
boost::function_requires
();
boost::function_requires >();
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' : default constructor could not
be generated
with
[
TT=std::back_insert_iterator,
ValueT=std::iterator_traits::value_type
]
c:\boost\boost\concept_check.hpp(48) : see reference to class
template instantiation 'boost::OutputIteratorConcept' being
compiled
with
[
TT=std::back_insert_iterator,
ValueT=std::iterator_traits::value_type
]
c:\Temp\concepttest\concepttest.cpp(16) : see reference to function
template instantiation 'void
boost::function_requires>(boost::mpl::identity<T>
*)' being compiled
with
[
TT=std::back_insert_iterator,
ValueT=std::iterator_traits::value_type,
T=boost::OutputIteratorConcept,std::iterator_traits::value_type>
]
c:\Temp\concepttest\concepttest.cpp(24) : see reference to function
template instantiation 'OutputIterator
process,std::back_insert_iterator<_Container>>(InputIterator,OutputIterator)'
being compiled
with
[
OutputIterator=std::back_insert_iterator,
_Ty=DirectoryEntry,
_Container=std::vector<DirectoryEntry>,
InputIterator=std::istream_iterator<DirectoryEntry>
]
c:\boost\boost\concept_check.hpp(573) : warning C4610: struct
'boost::OutputIteratorConcept' can never be instantiated - user
defined constructor required
with
[
TT=std::back_insert_iterator,
ValueT=std::iterator_traits::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
]
c:\boost\boost\concept_check.hpp(48) : see reference to class
template instantiation 'boost::AssignableConcept<TT>' being compiled
with
[
TT=std::back_insert_iterator
]
c:\boost\boost\concept_check.hpp(566) : see reference to function
template instantiation 'void
boost::function_requires(boost::mpl::identity<T>
*)' being compiled
with
[
TT=std::back_insert_iterator,
T=boost::AssignableConcept>
]
c:\boost\boost\concept_check.hpp(565) : while compiling
class-template member function 'void
boost::OutputIteratorConcept::constraints(void)'
with
[
TT=std::back_insert_iterator,
ValueT=std::iterator_traits::value_type
]
c:\boost\boost\concept_check.hpp(48) : see reference to class
template instantiation 'boost::OutputIteratorConcept' being
compiled
with
[
TT=std::back_insert_iterator,
ValueT=std::iterator_traits::value_type
]
c:\Temp\concepttest\concepttest.cpp(16) : see reference to function
template instantiation 'void
boost::function_requires>(boost::mpl::identity<T>
*)' being compiled
with
[
TT=std::back_insert_iterator,
ValueT=std::iterator_traits::value_type,
T=boost::OutputIteratorConcept,std::iterator_traits::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
]