ThreeB 1.1
debug.h
Go to the documentation of this file.
00001 /*
00002     This file is part of B-cubed.
00003 
00004     Copyright (C) 2009, 2010, 2011, Edward Rosten and Susan Cox
00005 
00006     B-cubed is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Lesser General Public
00008     License as published by the Free Software Foundation; either
00009     version 3.0 of the License, or (at your option) any later version.
00010 
00011     This library is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     Lesser General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License     
00017     along with this program.  If not, see <http://www.gnu.org/licenses/>
00018 */
00019 
00020 #ifndef STORM_INCLUDE_DEBUG_H
00021 #define STORM_INCLUDE_DEBUG_H
00022 
00023 #include <cassert>
00024 
00025 /** Determines that all images in the incoming container are the 
00026 same size, and that the container is not empty
00027 @param images Container to check
00028 @ingroup gDebug
00029 */
00030 template<class C> void assert_same_size(const C& images)
00031 {
00032     assert(!images.empty());
00033     for(typename C::const_iterator i=images.begin(); i != images.end(); i++)
00034         assert(i->size() == images.front().size());
00035 }
00036 
00037 
00038 #endif
00039