Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » styling of widgets ( animation / look and feel)
Re: styling of widgets ( animation / look and feel) [message #60861 is a reply to message #60860] Sun, 22 September 2024 09:38 Go to previous message
mirek is currently offline  mirek
Messages: 14261
Registered: November 2005
Ultimate Member
dodobar wrote on Sun, 22 September 2024 09:28
Thanks Mirek,
I tried a merge but get map.hpp conflict
template <class K, class T, class V>
template <class KK, class TT>
T&  AMap<K, T, V>::GetPut_(KK&& k, TT&& x)
{
<<<<<<< HEAD
	int i = key.Find(std::forward<KK>(k));
	if(i < 0) {
		i = key.Put(k);
		if(i < value.GetCount())
			return value[i] = std::forward<TT>(x);
		return value.Add(std::forward<TT>(x));
	}
	return value[i];
=======
	bool put = false;
	int i = key.FindPut(std::forward<KK>(k), put);
	if(i < value.GetCount()) {
		if(put)
			value[i] = std::forward<TT>(x);
		return value[i];
	}
	return value.Add(std::forward<TT>(x));
>>>>>>> master
}


Will try this, Hopefully this is ok ?? :

template <class K, class T, class V>
template <class KK, class TT>
T& AMap<K, T, V>::GetPut_(KK&& k, TT&& x)
{
    bool put = false;
    int i = key.FindPut(std::forward<KK>(k), put);
    if(i < value.GetCount()) {
        if(put) {
            value[i] = std::forward<TT>(x);  // Update if a new key was inserted
        }
        return value[i];  // Return the existing or updated value
    }
    return value.Add(std::forward<TT>(x));  // Add new value if not found
}

Yes...
Previous Topic: AsyncWork and pick/std::move problems...
Next Topic: U++ GTK Wayland Port
Goto Forum:
  


Current Time: Sun Jun 15 04:10:55 CEST 2025

Total time taken to generate the page: 0.04291 seconds