C++ boost::function::bad_function_call()














































C++ boost::function::bad_function_call()



Description: 
the bad_function_call is a class in which an exception type thrown when a instance of a function object is empty when invoked and it is exception thrown by boost::exception::operator().The main objective of the bad_call_function is that none of the function should be null because it  will effect the program in implementation. there is pictorial representation of the inheritance of exception of bad_function_call:


Syntax:
  boost::bad_function_call  &exception_variable

Member functions:
constructor():it constructs a bad_function_call exception object and it is public member function.
                         bad_function_call().
 destructor( ): it destroys a bad_function_call exception object and it is virtual public member function.
                         ~bad_function_call( )
what() :          this  function return the meaning full explanatory string of the exception.

program:

#include <boost/function.hpp> // the main header file we have use #include <iostream> int main() { try { boost::function<int(const char*)> f; f(""); // AS WE CAN SEE THAT THE F IS EMPTY OR IT CAN BE BY USING NULLPTR IN FUNCTION f THERE IS NOTHIMG } catch (boost::bad_function_call &ex)// HERE THE EXCEPTION IS BEEN THROWN { std::cout << ex.what() << '\n';// WHAT IS THE FUNCTION SENDS THE EXPLANATORY STRING } }

output:

call to empty boost::function


More Articles of Konada Sunita:

Name Views Likes
C++ boost::accumulator::p_square_cumulative_distribution 672 1
C++ boost::Numeric Conversion::converter<> 864 10
C++ boost::ref 1227 9
C++ boost::accumulator::count 930 2
C++ boost::function::function_base 556 10
C++ boost::accumulator::weighted_mean 889 1
C++ boost::accumulator::non_coherent_weighted_tail_mean 563 1
C++ boost::accumulator::rolling_count rolling_sum rolling_mean rolling_moment 727 2
C++ boost::lockfree::spsc_queue 2202 10
C++ boost::coroutine:: passing data 640 1
C++ boost::accumulator::weighted_tail_quantile 619 1
C++ boost::TokenizerClass 83 2
C++ boost::accumulator::weighted_variance 559 1
C++ boost::accumulator::rolling mean 2595 2
C++ boost::accumulator::median 1417 1
C++ boost::accumulator::extended_p_square_quantile 837 1
C++ boost::accumulator::extended_p_square 648 1
C++ boost::function::functionN 829 10
C++ boost::accumulator::weighted_density 505 1
C++ boost::accumulator::covariance density 780 3
C++ boost::accumulator::weighted_skewness 503 1
C++ boost::format::formatter 654 10
C++ boost::accumulator::skewness 911 1
C++ boost::accumulator::max 700 3
C++ boost::accumulator::variance 992 1
C++ boost::accumulator::min 592 2
C++ boost::accumulator::density 951 1
C++ boost::token_iterator 885 10
c++ program to print root to leaf paths without using recursion 704 10
C++ boost::accumulator::rolling variance 1476 4
C++ boost::accumulator::weighted_sum 544 1
C++ boost::accumulator::weighted_extended_p_square_quantile 605 2
C++ boost::accumulator::sum_kahan 1117 2
C++ boost::accumulator::weighted_moment 469 1
C++ boost::accumulator::error_of 658 2
C++ boost::accumulator::tail 845 2
C++ boost::format 4138 10
C++ boost::accumulator::weighted_p_square_cumulative_distribution 522 1
C++ boost::accumulator::coherent_tail_mean 471 1
C++ boost::accumulator::rolling count 1153 2
C++ boost::accumulator::moment 703 2
C++ boost::lockfree::stack 1207 8
C++ boost::accumulator::sum 821 2
C++ boost::function::bad_function_call() 1096 10
C++ boost::accumulators::Mean Moment Count 1370 2
C++ boost::accumulator::mean 1617 2
C++ boost::accumulator::non_coherent_tail_mean 501 1
C++ boost::accumulator::weighted_extended_p_square 521 1
C++ boost::accumulator::weighted_kurtosis 522 1
C++ boost::accumulator::covariance density error_of_mean 587 9
C++ boost::accumulator::rolling sum 834 2
C++ boost::lockfree::queue 3084 9
C++ boost::accumulator::weighted_p_square_quantile 852 1
C++ boost::accumulator::p_square_quantile 840 1
C++ boost::accumulator::tail_quantile 1201 1
C++ boost::accumulator::rolling moment 598 2
C++ boost::accumulator::min max 1230 3
C++ boost::accumulator::kurtosis 1209 1
C++ boost::coroutine::Pushtype and pulltype 1564 1
C++ boost::accumulator::tail_variate 491 2
C++ boost::accumulator::weighted_covariance 519 2
C++ boost::format::Exception 2202 10
C++ boost::function 3034 10
C++ boost::NumericConversion::bounds<> 677 10
C++ boost::NumericConversion::UDT 853 10

Comments