aboutsummaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/types/ranges.hpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/host/include/uhd/types/ranges.hpp b/host/include/uhd/types/ranges.hpp
index 361b0e9d3..05aa0fa7c 100644
--- a/host/include/uhd/types/ranges.hpp
+++ b/host/include/uhd/types/ranges.hpp
@@ -9,6 +9,7 @@
#include <uhd/config.hpp>
#include <string>
+#include <type_traits>
#include <vector>
namespace uhd {
@@ -76,6 +77,14 @@ struct UHD_API meta_range_t : std::vector<range_t>
meta_range_t(InputIterator first, InputIterator last)
: std::vector<range_t>(first, last)
{ /* NOP */
+ // This is to avoid people accidentally doing silly things like:
+ // meta_range_t(0, 0)
+ // which probably was supposed to call meta_range_t(double, double, double)
+ // but actually calls this constructor.
+ static_assert(
+ !std::is_integral<typename std::decay<InputIterator>::type>::value,
+ "You can't pass integers to meta_range_t's constructor!"
+ );
}
/*!