Commit 30dbb5d7 authored by Davis King's avatar Davis King

Added some code to cause the user to get a compiler error if they accidentally

try to combine a quantum gate with an integer.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402709
parent 36e7c358
...@@ -559,6 +559,11 @@ namespace dlib ...@@ -559,6 +559,11 @@ namespace dlib
return qc_helpers::combine_gates<T,U,V>::eval(lhs,rhs); return qc_helpers::combine_gates<T,U,V>::eval(lhs,rhs);
} }
// If you are getting an error here then it means that you are trying to combine a gate expression
// with an integer somewhere (and that is an error).
template <typename T> void operator, ( const gate_exp<T>&, int) { COMPILE_TIME_ASSERT(sizeof(T) > 100000000); }
template <typename T> void operator, ( int, const gate_exp<T>&) { COMPILE_TIME_ASSERT(sizeof(T) > 100000000); }
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
namespace quantum_gates namespace quantum_gates
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment