mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-23 16:22:15 +00:00
Spans are more flexible and can be constructed from any contiguous container (such as small_vector), or a subrange of such a container. This can save allocations, so change the signature to accept a span. Spans cannot be constructed from std::initializer_list, so one such call site is changed to use construct a span directly from the single argument.
32 lines
555 B
C++
32 lines
555 B
C++
/*
|
|
* Modified by ScyllaDB
|
|
*
|
|
* Copyright (C) 2015-present ScyllaDB
|
|
*/
|
|
|
|
/*
|
|
* SPDX-License-Identifier: (AGPL-3.0-or-later and Apache-2.0)
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "types/types.hh"
|
|
#include "native_scalar_function.hh"
|
|
#include "utils/UUID.hh"
|
|
|
|
namespace cql3 {
|
|
|
|
namespace functions {
|
|
|
|
inline
|
|
shared_ptr<function>
|
|
make_uuid_fct() {
|
|
return make_native_scalar_function<false>("uuid", uuid_type, {},
|
|
[] (std::span<const bytes_opt> parameters) -> bytes_opt {
|
|
return {uuid_type->decompose(utils::make_random_uuid())};
|
|
});
|
|
}
|
|
|
|
}
|
|
}
|