c++ - Can I avoid returning a template return type of a function? -


i building priority que, , trying make template class. when pop, must return type t. there way return nothing or practice avoid crash if there nothing in que?

the expected behavior here throw exception. user should check queue being empty before trying pop. return null well, if type t never has value of null, otherwise ambiguous if being returned because error happened or because next value in queue null.


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

ruby - Nesting modules inside of a Rails eninge gem -

Eclipse formatter for java ending braces -