Make `Property<string>` convertible to `string_view`
This should work:
void f(std::string_view);
Gaudi::Property<std::string> prop{"abc"};
f(prop);
today we have to use f(prop.value())
.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
- Show closed items
Link issues together to show that they're related or that one is blocking others.
Learn more.
Related merge requests 124
When these merge requests are accepted, this issue will be closed automatically.
- lhcb/Allen !676
- lhcb/Allen !655
- lhcb/Allen !676
- lhcb/Allen !655
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Developer
diff --git a/GaudiKernel/GaudiKernel/Property.h b/GaudiKernel/GaudiKernel/Property.h index dcc0a7859..944fc204a 100644 --- a/GaudiKernel/GaudiKernel/Property.h +++ b/GaudiKernel/GaudiKernel/Property.h @@ -483,6 +483,12 @@ namespace Gaudi { // return m_value; // } + template < typename Dummy = TYPE, typename = std::enable_if_t< std::is_constructible_v< std::string_view, Dummy > > > + operator std::string_view() const { + m_handlers.useReadHandler( *this ); + return m_value; + } + /// equality comparison template <class T> bool operator==( const T& other ) const {
???
- Gerhard Raven mentioned in commit f26b44f1
mentioned in commit f26b44f1
- Gerhard Raven mentioned in merge request !1002 (merged)
mentioned in merge request !1002 (merged)
- Gerhard Raven mentioned in commit 08c96df8
mentioned in commit 08c96df8
- Marco Clemencic assigned to @graven
assigned to @graven
- Marco Clemencic changed milestone to %v33r0
changed milestone to %v33r0
- Gerhard Raven mentioned in commit 56189480
mentioned in commit 56189480
- Gerhard Raven mentioned in commit 3814bfdd
mentioned in commit 3814bfdd
- Gerhard Raven mentioned in commit ac500329
mentioned in commit ac500329
- Marco Clemencic closed via merge request !1002 (merged)
closed via merge request !1002 (merged)
- Marco Clemencic mentioned in commit b9b1aa54
mentioned in commit b9b1aa54
Please register or sign in to reply