mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-29 03:32:48 +00:00
Modify base::convert_to() undefined implementation
GCC shows divide-by-zero warnings, so it is better in this way.
This commit is contained in:
parent
cde54f3682
commit
5d0c25b0da
@ -17,7 +17,11 @@ namespace base {
|
||||
// Undefined convertion
|
||||
template<typename To, typename From>
|
||||
To convert_to(const From& from) {
|
||||
enum { not_supported = 1/(1 == 0) }; // static_assert(false)
|
||||
// As this function doesn't return a value, if a specialization is
|
||||
// not found, a compiler error will be thrown (which means that
|
||||
// the conversion isn't supported).
|
||||
|
||||
// TODO Use a static_assert(false)
|
||||
}
|
||||
|
||||
template<> int convert_to(const base::string& from);
|
||||
|
Loading…
x
Reference in New Issue
Block a user