C++ boost::type_traits::has_post_decrement














































C++ boost::type_traits::has_post_decrement



Description:
boost::has_post_decrement will check if the argument can be used with post decrement operator.

Syntax:
boost::has_post_decrement<arg1, arg2>::value_type
or
boost::has_post_decrement<arg1, arg2>::value ( all the two are not necessary )

arg1 is checked if it can be used with the operator as in the description and if the result of the operator can be converted to arg2, then it inherits from true_type.
Headers:
#include<boost/type_traits.hpp>
or
#include<boost/type_traits/has_operator.hpp>
or
#include<boost/type_traits/has_post_decrement.hpp>

Sample Code:
#include<iostream>
#include<boost/type_traits.hpp>
//#include<boost/type_traits/has_post_decrement.hpp>
//#include<boost/type_traits/has_operator.hpp>
using namespace std;
int main()
{
cout<<boolalpha;
cout<<boost::has_post_decrement<int, int>::value<<endl;
cout<<boost::has_post_decrement<float, int>::value<<endl;
cout<<boost::has_post_decrement<int*>::value<<endl;
cout<<boost::has_post_decrement<string>::value<<endl;
cout<<boost::has_post_decrement<int, string>::value<<endl;
cout<<boost::has_post_decrement<long>::value<<endl;

return 0;
}

Output:
true
true
true
false
false
true


More Articles of Ayush Ranjan:

Name Views Likes
C++ boost::type_traits::remove_volatile 597 12
C++ boost::type_traits::is_object 488 6
C++ boost::type_traits::is_destructible 481 1
C++ boost::type_traits::has_nothrow_copy 363 6
C++ boost::type_traits::is_const 458 1
C++boost::EnableIf 604 2
C++ boost::type_traits::has_virtual_destructor 449 5
C++ boost::type_traits::remove_extent 510 4
C++ boost::type_traits::has_post_increment 363 4
C++ boost::type_traits::extent 403 1
C++ boost::type_traits::is_enum 562 11
C++ boost::type_traits::has_unary_minus 479 7
C++ boost::type_traits::has_minus 346 2
C++ boost::type_traits::is_member_pointer 515 14
C++ boost::type_traits::has_divides_assign 322 1
C++ boost::type_traits::has_divides 339 1
C++ boost::type_traits::has_bit_or_assign 383 1
C++ boost::type_traits::has_bit_or 436 1
C++ boost::type_traits::has_equal_to 381 1
C++ boost::type_traits::has_nothrow_constructor 445 3
C++ boost::type_traits::has_negate 398 35
C++ boost::type_traits::has_trivial_move_assign 485 8
C++ boost::type_traits::has_pre_increment 539 10
C++ boost::type_traits::is_virtual_base_of 515 1
C++ boost::type_traits::is_member_object_pointer 504 15
C++ boost::type_traits::remove_reference 482 11
C++ boost::type_traits::rank 427 5
C++ boost::type_traits::is_union 616 11
C++ boost::type_traits::has_unary_plus 408 9
C++ boost::type_traits::remove_const 458 15
C++ boost::type_traits::is_unsigned 509 14
C++ boost::type_traits::add_lvalue_reference 364 1
C++ boost::type_traits::has_less 358 1
C++ boost::type_traitsis_fundamental 428 12
C++ boost::type_traits::has_trivial_destructor 445 23
C++ boost::lambda 712 1
C++ boost::type_traits::decay 393 1
C++ boost::type_traits::copy_cv 406 1
C++ boost::type_traits::aligned_storage 358 1
C++ boost::type_traits::is_member_function_pointer 486 14
C++ boost::type_traits::add_pointer 397 1
C++ boost::type_traits::has_bit_xor 372 1
C++ boost::type_traits::remove_pointer 502 5
C++ boost::type_traits::has_bit_xor_assign 339 1
C++ boost::type_traits::add_rvalue_reference 363 1
C++ boost::type_traits::make_signed 463 4
C++ boost::type_traits::promote 527 21
C++ boost::type_traits::has_bit_and_assign 324 3
C++ boost::type_traits::common_type 379 1
C++ boost::type_traits::is_same 503 0
C++ boost::type_traits::is_rvalue_reference 550 9
C++ boost::type_traits::has_plus 383 21
C++ boost::foreach 1498 1
C++ boost::type_traits::is_compound 472 1
C++ boost::type_traits::add_const 400 1
C++ boost::type_traits::add_cv 493 1
C++ boost::type_traits::has_greater_equal 382 1
C++ boost::type_traits::remove_all_extents 507 9
C++ boost::type_traits::is_array 543 23
C++ boost::type_traits::function_traits 733 1
C++ boost::type_traits::has_nothrow_destructor 367 5
C++ boost::type_traits::has_plus_assign 366 4
C++ boost::type_traits::make_signed 77 9
C++ boost::type_traits::is_base_of 454 17
C++ boost::type_traits::has_post_decrement 419 56
C++ boost::type_traits::is_constructible 510 1
C++ boost::type_traits::has_dereference 337 1
C++ boost::type_traits::is_volatile 500 1
C++ Boost Lambda 699 1
C++ boost::type_traits::has_not_equal_to 399 2
C++ boost::type_traits::is_function 466 17
C++ boost::type_traits::is_abstract 499 18
C++ boost::type_traits::type_with_alignment 569 10
C++ boost::type_traits::has_multiplies 473 16
C++ boost::type_traits::is_final 465 6
C++ boost::type_traits::type_identity 539 9
C++ boost::type_traits::is_assignable 431 33
C++ boost::type_traits::has_greater 334 1
C++ boost::type_traits::has_unary_plus 413 8
C++ boost::type_traits::has_trivial_assign 373 3
C++ boost::type_traits::is_default_constructible 438 2
C++ boost::Type_traits::is_arithmetic 459 21
C++ boost::type_traits::is_complex 767 8
C++ boost::type_traits::has_logical_and 358 1
C++ boost::type_traits::has_pre_decrement 314 0
C++ boost::type_traits::has_left_shift 328 1
C++ boost::type_traits::alignment_of 432 1
C++ boost::type_traits::has_trivial_constructor 407 4
C++ boost::type_traits::has_modulus 357 2
C++ boost::type_traits::is_copy_assignable 395 7
C++ boost::type_traits::is_polymorphic 491 8
C++ boost::type_traits::is_signed 559 9
C++ boost::type_traits::make_unsigned 513 21
C++ boost::type_traits::integral_constant 402 34
C++ boost::type_traits::is_pointer 481 19
C++ boost::type_traits::is_pod 484 17
C++ boost::type_traits::is_integral 587 15
C++ boost::type_traits::has_right_shift_assign 321 10
C++ boost::type_traits::remove_cv 548 6
C++ boost::type_traits::has_logical_not 322 1
C++ boost::type_traits::integral_promotion 399 4
C++ boost::type_traits::has_minus_assign 328 2
C++ boost::type_traits::is_nothrow_move_constructible 472 25
C++ boost::type_traits::declval 372 1
C++ boost::type_traits::has_multiplies_assign 386 46
C++ boost::type_traits::add_volatile 359 1
C++ boost::type_traits::is_nothrow_move_assignable 469 8
C++ boost::type_traits::is_scalar 520 13
C++ boost::type_traits::is_void 522 9
C++ boost::type_traits::is_empty 438 4
Program to check whether a number is Palindrome or not 481 2
C++ boost::type_traits::has_right_shift 377 5
C++ boost::type_traits::left_shift_assign 414 1
C++ boost::type_traits::has_logical_or 436 1
C++ boost::type_traits::add_reference 422 1
C++ boost::type_traits::has_modulus_assign 338 3
C++ boost::type_traits::is_floating_point 459 6
C++ boost::type_traits::is_convertible 444 4
C++ boost::type_traits::is_lvalue_reference 444 7
C++ boost::type_traits::has_new_operator 360 24
C++ boost::type_traits::has_less_equal 328 1
C++ boost::type_traits::has_trivial_move_constructor 368 6
C++ boost::type_traits::is_reference 477 0
C++ boost::type_traits::has_complement 277 1
C++ boost::type_traits::has_bit_and 283 1
C++ boost::type_traits::floating_point_promotion 317 1
C++ boost::type_traits::has_unary_minus 320 10
C++ boost::type_traits::has_nothrow_assgin 416 6
C++ boost::type_traits::has_trivial_copy 315 4
C++ boost::type_traits::is_class 469 14
C++ boost::type_traits::is_copy_constructible 439 13
C++ boost::type_traits::conditional 298 1
C++ boost::type_traits::is_stateless 437 3

Comments