locked
cloud_table_entity set method with string / string parameters

    Question

  • I tried setting a property on a cloud_table_entity like this:

    signal.set(U("SomeProperty"), "SomeValue");

    which calls the  cloud_table_entity& set(const casablanca::string_t& property_name, bool boolean_value) overload, and I therefore had to call

    signal.set(U("SomeProperty"), U("SomeValue"), cloud_table_entity::String);

    to call the correct overload. I know table support is incomplete, but I think that is quite a big gun pointing at my foot ;)

    -phil


    www.timecockpit.com

    Wednesday, October 03, 2012 6:26 AM

Answers

  • Philipp,

    Thanks for your feedback. It is indeed unfortunate that char* resolves to bool, and also the reason we introduced the overload that requires you to specify the type. But as you said, it's easy to make that mistake and not realize until much later. I will file a bug on this issue, and see if we can do something to produce an error or windows for single char string literal, and make the version that takes a wide char literal just work.

    --Geni

    • Marked as answer by Philipp Aumayr Thursday, October 04, 2012 8:42 AM
    Wednesday, October 03, 2012 7:58 PM

All replies

  • Philipp,

    Thanks for your feedback. It is indeed unfortunate that char* resolves to bool, and also the reason we introduced the overload that requires you to specify the type. But as you said, it's easy to make that mistake and not realize until much later. I will file a bug on this issue, and see if we can do something to produce an error or windows for single char string literal, and make the version that takes a wide char literal just work.

    --Geni

    • Marked as answer by Philipp Aumayr Thursday, October 04, 2012 8:42 AM
    Wednesday, October 03, 2012 7:58 PM
  • Hi Geni,

    in my case i would always want to specify the exact type, and I would want to be forced to specify the type I want. But that is my personal preference, and I can see the value in the derive-from-parameter-type approach!

    thank you!

    phil


    www.timecockpit.com

    Thursday, October 04, 2012 8:42 AM