Browse Source

fix cut & paste errors, so the compiler is happy again. :)

master
roker 4 years ago
parent
commit
8dd301c251
  1. 13
      src/identity.cc
  2. 2
      src/types.hh

13
src/identity.cc

@ -13,30 +13,31 @@ namespace pEp
} }
template<> template<>
pEp_identity* identity_list::* const ListWrapper<identity_list*, const char*>::Value = &identity_list::ident; ::pEp_identity* identity_list::* const ListWrapper<::identity_list*, ::pEp_identity*>::Value
= &identity_list::ident;
template<> template<>
int identity_list::size() const int IdentityList::size() const
{ {
return identity_list_length(value); return identity_list_length(value);
} }
// faster than .size()==0 because it's not necessary to iterate throgh the whole list // faster than .size()==0 because it's not necessary to iterate throgh the whole list
template<> template<>
bool identity_list::empty() const bool IdentityList::empty() const
{ {
return !(value && value->ident); return !(value && value->ident);
} }
template<> template<>
void identity_list::clear() void IdentityList::clear()
{ {
free_identity_list(value); free_identity_list(value);
value = nullptr; value = nullptr;
} }
template<> template<>
void identity_list::push_back(pEp_identity*&& id) void IdentityList::push_back(pEp_identity*&& id)
{ {
auto last = identity_list_add(value, id); auto last = identity_list_add(value, id);
if(value==nullptr) if(value==nullptr)
@ -46,7 +47,7 @@ namespace pEp
template<> template<>
ListWrapper<::identity_list*, pEp_identity*>::ListWrapper(const std::initializer_list<Wrapper<pEp_identity*>>& il) ListWrapper<::identity_list*, pEp_identity*>::ListWrapper(const std::initializer_list<Wrapper<pEp_identity*>>& il)
: identity_list{} : Base{}
{ {
::identity_list* last = nullptr; ::identity_list* last = nullptr;
for(const Wrapper<pEp_identity*>& id : il) for(const Wrapper<pEp_identity*>& id : il)

2
src/types.hh

@ -21,7 +21,7 @@ namespace pEp
}; };
using Identity = Wrapper<::pEp_identity*>; using Identity = Wrapper<::pEp_identity*>;
using IdentityList = ListWrapper<::pEp_identity_list*, ::pEp_identity*>; using IdentityList = ListWrapper<::identity_list*, ::pEp_identity*>;
using StringPair = Wrapper<::stringpair_t*>; using StringPair = Wrapper<::stringpair_t*>;
using StringPairList = ListWrapper<::stringpair_list_t*, ::stringpair_t*>; using StringPairList = ListWrapper<::stringpair_list_t*, ::stringpair_t*>;

Loading…
Cancel
Save