revise shared_vector casting
Rename existing castTo() as castToUnsafe(). Add new castTo() which is doesn't allow non-void -> non-void and may throw on void -> non-void
This commit is contained in:
@@ -203,6 +203,11 @@ std::ostream& operator<<(std::ostream& strm, const Limiter& lim)
|
||||
return strm;
|
||||
}
|
||||
|
||||
void _throw_bad_cast(ArrayType from, ArrayType to)
|
||||
{
|
||||
throw std::logic_error(SB()<<"Unable to cast array from "<<from<<" to "<<to);
|
||||
}
|
||||
|
||||
Escaper::Escaper(const char* v)
|
||||
:val(v)
|
||||
,count(v ? strlen(v) : 0)
|
||||
|
||||
Reference in New Issue
Block a user