Supress warnings in array

[SVN r53105]
This commit is contained in:
Steven Watanabe
2009-05-19 03:00:53 +00:00
parent 9cf5e0c9a1
commit 471bc9bf06
3 changed files with 7 additions and 7 deletions

View File

@ -211,19 +211,19 @@ namespace boost {
} }
// operator[] // operator[]
reference operator[](size_type i) reference operator[](size_type /*i*/)
{ {
return failed_rangecheck(); return failed_rangecheck();
} }
const_reference operator[](size_type i) const const_reference operator[](size_type /*i*/) const
{ {
return failed_rangecheck(); return failed_rangecheck();
} }
// at() with range check // at() with range check
reference at(size_type i) { return failed_rangecheck(); } reference at(size_type /*i*/) { return failed_rangecheck(); }
const_reference at(size_type i) const { return failed_rangecheck(); } const_reference at(size_type /*i*/) const { return failed_rangecheck(); }
// front() and back() // front() and back()
reference front() reference front()
@ -252,7 +252,7 @@ namespace boost {
static size_type max_size() { return 0; } static size_type max_size() { return 0; }
enum { static_size = 0 }; enum { static_size = 0 };
void swap (array<T,0>& y) { void swap (array<T,0>& /*y*/) {
} }
// direct access to data (read-only) // direct access to data (read-only)

View File

@ -21,7 +21,7 @@ int main()
// copy and change order // copy and change order
boost::array<std::string,4> seasons_orig = seasons; boost::array<std::string,4> seasons_orig = seasons;
for (unsigned i=seasons.size()-1; i>0; --i) { for (std::size_t i=seasons.size()-1; i>0; --i) {
std::swap(seasons.at(i),seasons.at((i+1)%seasons.size())); std::swap(seasons.at(i),seasons.at((i+1)%seasons.size()));
} }

View File

@ -27,7 +27,7 @@ int main()
typedef boost::array<float,6> Array; typedef boost::array<float,6> Array;
// create and initialize an array // create and initialize an array
const Array a = { { 42.42 } }; const Array a = { { 42.42f } };
// use some common STL container operations // use some common STL container operations
std::cout << "static_size: " << a.size() << std::endl; std::cout << "static_size: " << a.size() << std::endl;