MCPcopy Create free account
hub / github.com/davisking/dlib / assign_scalar

Function assign_scalar

dlib/matlab/mex_wrapper.cpp:499–516  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

497 typename U
498 >
499 typename dlib::enable_if_c<is_built_in_scalar_type<T>::value || is_same_type<T,bool>::value >::type
500 assign_scalar (
501 const long arg_idx,
502 T& dest,
503 const U& src
504 )
505 {
506 if (is_signed_type<U>::value && src < 0 && is_unsigned_type<T>::value)
507 {
508 std::ostringstream sout;
509 sout << "Error, input argument " << arg_idx+1 << " must be a non-negative number.";
510 throw invalid_args_exception(sout);
511 }
512 else
513 {
514 dest = src;
515 }
516 }
517
518 template <
519 typename T,

Callers 1

Calls 1

Tested by

no test coverage detected