lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 61c1056 2/6: Demonstrate effect of redundantl


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 61c1056 2/6: Demonstrate effect of redundantly specifying deduced template parameter
Date: Wed, 7 Nov 2018 02:40:34 -0500 (EST)

branch: master
commit 61c10565e8454b747b7972a5f9d1169519033291
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Demonstrate effect of redundantly specifying deduced template parameter
---
 input_test.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/input_test.cpp b/input_test.cpp
index 413c94f..16e817f 100644
--- a/input_test.cpp
+++ b/input_test.cpp
@@ -159,6 +159,12 @@ void input_test::test_product_database()
     auto const b {db.query<oenum_alb_or_anb>(DB_MaturityAge)};
     BOOST_TEST_EQUAL(100, b);
 
+    // Redundant template argument is okay.
+    db.query_into<oenum_alb_or_anb>(DB_MaturityAge, a);
+    // Fails to compile with wrong template argument:
+//  db.query_into<float>(DB_MaturityAge, a);
+//  db.query_into<bool >(DB_MaturityAge, a);
+
     // This value is not integral, so bourn_cast rejects it.
     BOOST_TEST_THROW
         (db.query_into(DB_NaarDiscount, a)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]