C++11 std::shared_ptr fixes:

Test for C++11 std::shared_ptr was always failing because std::make_shared was
calling a constructor of 1 argument which did not exist for the struct A. Changed
test code snippet to call default no argument constructor of A.

Once C++11 std::shared_ptr support was fixed, contentDispositionField.cpp and
contentTypeField.cpp would not compile because std::shared_ptr cannot be implicitly
cast to bool (i.e. in a return statement). Added explicit cast to bool.
This commit is contained in:
tholdawa 2014-01-14 15:28:58 -08:00
parent fe43da096f
commit d4c5386556
3 changed files with 9 additions and 9 deletions

View File

@ -815,7 +815,7 @@ CHECK_CXX_SOURCE_COMPILES(
#include <memory>
struct A { int foo; };
int main() {
std::shared_ptr <A> a = std::make_shared <A>(a);
std::shared_ptr <A> a = std::make_shared <A>();
return 0;
}
"

View File

@ -42,7 +42,7 @@ contentDispositionField::contentDispositionField(contentDispositionField&)
bool contentDispositionField::hasCreationDate() const
{
return findParameter("creation-date");
return bool(findParameter("creation-date"));
}
@ -65,7 +65,7 @@ void contentDispositionField::setCreationDate(const datetime& creationDate)
bool contentDispositionField::hasModificationDate() const
{
return findParameter("modification-date");
return bool(findParameter("modification-date"));
}
@ -88,7 +88,7 @@ void contentDispositionField::setModificationDate(const datetime& modificationDa
bool contentDispositionField::hasReadDate() const
{
return findParameter("read-date");
return bool(findParameter("read-date"));
}
@ -111,7 +111,7 @@ void contentDispositionField::setReadDate(const datetime& readDate)
bool contentDispositionField::hasFilename() const
{
return findParameter("filename");
return bool(findParameter("filename"));
}
@ -134,7 +134,7 @@ void contentDispositionField::setFilename(const word& filename)
bool contentDispositionField::hasSize() const
{
return findParameter("size");
return bool(findParameter("size"));
}

View File

@ -42,7 +42,7 @@ contentTypeField::contentTypeField(contentTypeField&)
bool contentTypeField::hasBoundary() const
{
return findParameter("boundary");
return bool(findParameter("boundary"));
}
@ -65,7 +65,7 @@ void contentTypeField::setBoundary(const string& boundary)
bool contentTypeField::hasCharset() const
{
return findParameter("charset");
return bool(findParameter("charset"));
}
@ -88,7 +88,7 @@ void contentTypeField::setCharset(const charset& ch)
bool contentTypeField::hasReportType() const
{
return findParameter("report-type");
return bool(findParameter("report-type"));
}