Esempio n. 1
0
/**
 * Tests if the first set is less than or equal to the second set.
 */
bool_t set_less_equal(const set_t* cpset_first, const set_t* cpset_second)
{
    assert(cpset_first != NULL);
    assert(cpset_second != NULL);

#ifdef CSTL_SET_AVL_TREE
    return _avl_tree_less_equal(&cpset_first->_t_tree, &cpset_second->_t_tree);
#else
    return _rb_tree_less_equal(&cpset_first->_t_tree, &cpset_second->_t_tree);
#endif
}
Esempio n. 2
0
bool_t map_less_equal(const map_t* cpt_mapfirst, const map_t* cpt_mapsecond)
{
    assert(cpt_mapfirst != NULL && cpt_mapsecond != NULL);
    assert(_same_map_pair_type(&cpt_mapfirst->_t_pair, &cpt_mapsecond->_t_pair));

#ifdef CSTL_MAP_AVL_TREE
    return _avl_tree_less_equal(
        _GET_MAP_AVL_TREE(cpt_mapfirst), _GET_MAP_AVL_TREE(cpt_mapsecond));
#else
    return _rb_tree_less_equal(
        _GET_MAP_RB_TREE(cpt_mapfirst), _GET_MAP_RB_TREE(cpt_mapsecond));
#endif
}
Esempio n. 3
0
/**
 * Tests if the first map is less than or equal to the second map.
 */
bool_t map_less_equal(const map_t* cpmap_first, const map_t* cpmap_second)
{
    assert(cpmap_first != NULL);
    assert(cpmap_second != NULL);
    assert(_pair_is_inited(&cpmap_first->_pair_temp));
    assert(_pair_is_inited(&cpmap_second->_pair_temp));
    assert(_map_same_pair_type_ex(&cpmap_first->_pair_temp, &cpmap_second->_pair_temp));

#ifdef CSTL_MAP_AVL_TREE
    return _avl_tree_less_equal(&cpmap_first->_t_tree, &cpmap_second->_t_tree);
#else
    return _rb_tree_less_equal(&cpmap_first->_t_tree, &cpmap_second->_t_tree);
#endif
}