Giter VIP home page Giter VIP logo

Comments (2)

awaa avatar awaa commented on August 16, 2024

char[n] 这样的在很多sdk都是这么声明的。期待实现

from iguana.

awaa avatar awaa commented on August 16, 2024

lazy

template <typename T>
concept char_array_t = std::is_same_v<typename std::remove_extent<T>::type, char>;

template <class T>
concept str_t =
    std::convertible_to<std::decay_t<T>, std::string_view> && !str_view_t<T>
    && !char_array_t<T>;

template <typename Type>
concept fixed_array = (c_array<Type> || array<Type>)
            && !char_array_t<Type>;

template<char_array_t U, class It, size_t n>
IGUANA_INLINE void parse_item(U(&charArray)[n], It&& it, It&& end) {
    std::string parsed_str;
    parse_item<std::string, It>(parsed_str, it, end);
    parsed_str.copy(charArray, n-1);
}

template <typename Stream, char_array_t T, size_t n>
IGUANA_INLINE void render_json_value(Stream& ss, T(&t)[n]) {
    ss.push_back('"');
    ss.append(t);
    ss.push_back('"');


from iguana.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.