Skip to content
Snippets Groups Projects
Commit 1a2b7f15 authored by Nicolas Leclercq's avatar Nicolas Leclercq
Browse files

Added yat::any_cast_ext (mantis # 0024344 - tested on Linux)

parent f6ab8b09
Branches
Tags
No related merge requests found
......@@ -41,7 +41,7 @@
<dependency>
<groupId>fr.soleil.lib</groupId>
<artifactId>YAT-${aol}-${library}-${mode}</artifactId>
<version>1.7.2</version>
<version>1.7.12-SNAPSHOT</version>
</dependency>
</dependencies>
<developers>
......
......@@ -104,6 +104,23 @@ int main(int argc, char* argv[])
std::cout << "ko: yat::Any::any_cast<int> failed!" << std::endl;
}
//- try to extract an <int> from an Any holding an <int&>
//- this should complete successfully
try
{
int int_val = yat::any_cast_ext<int>(any_holding_ref);
std::cout << "ok: yat::Any::any_cast_ext<int> returned "
<< int_val
<< " as expected"
<< std::endl;
}
catch (const yat::Exception&)
{
std::cout << "ko: yat::Any::any_cast<int> failed!" << std::endl;
}
//- try to extract an <int> from an Any holding an <int*>
//- this should fail!
try
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment